Skip to content

Commit 93fb809

Browse files
committed
fixed small warnings
1 parent dfde7ae commit 93fb809

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/main/kotlin/imgui/TextEditState.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ class TextEditState {
419419
val r = Row()
420420
val n = curLenW
421421
var baseY = 0f
422-
var prevX = 0f
422+
var prevX: Float
423423
var i = 0
424424

425425
// search rows to find one that straddles 'y'
@@ -626,7 +626,7 @@ class TextEditState {
626626
var prevStart = 0
627627
val z = curLenW
628628
var i = 0
629-
var first = 0
629+
var first: Int
630630

631631
if (n == z) {
632632
// if it's at the end, then find the last line -- simpler than trying to
@@ -877,11 +877,10 @@ class TextEditState {
877877
// now find character position down a row
878878
if (find.length != 0) {
879879
val goalX = if (hasPreferredX) preferredX else find.x
880-
var x = 0f
880+
var x = row.x0
881881
val start = find.firstChar + find.length
882882
cursor = start
883883
layout(row, cursor)
884-
x = row.x0
885884
for (i in 0 until row.numChars) {
886885
val dx = getWidth(start, i)
887886
if (dx == GETWIDTH_NEWLINE)

src/main/kotlin/imgui/draw.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,10 +769,10 @@ class DrawList(sharedData: DrawListSharedData?) {
769769
// }
770770
// }
771771

772-
fun pathRect(a: Vec2, b: Vec2, rounding: Float = 0f, roundingCorners: Int = Dcf.All.i) {
772+
fun pathRect(a: Vec2, b: Vec2, rounding_: Float = 0f, roundingCorners: Int = Dcf.All.i) {
773773

774774
var cond = ((roundingCorners and Dcf.Top) == Dcf.Top.i) || ((roundingCorners and Dcf.Bot) == Dcf.Bot.i) // TODO consider simplyfing
775-
var rounding = glm.min(rounding, glm.abs(b.x - a.x) * (if (cond) 0.5f else 1f) - 1f)
775+
var rounding = glm.min(rounding_, glm.abs(b.x - a.x) * (if (cond) 0.5f else 1f) - 1f)
776776
cond = ((roundingCorners and Dcf.Left) == Dcf.Left.i) || ((roundingCorners and Dcf.Right) == Dcf.Right.i)
777777
rounding = glm.min(rounding, glm.abs(b.y - a.y) * (if (cond) 0.5f else 1f) - 1f)
778778

0 commit comments

Comments
 (0)