Skip to content

Commit b94186b

Browse files
committed
🔥 fixed last small bastard bug, columns working
back online 🌐
1 parent ceda81e commit b94186b

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/main/kotlin/imgui/helpers.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class Storage {
8888

8989
fun clear() = data.clear()
9090

91-
fun intaaaaaaaaa(key: Int, defaultVal: Int = 0) = data[key] ?: defaultVal // TODO rename back
91+
fun intaaaaaaaaaaa(key: Int, defaultVal: Int = 0) = data[key] ?: defaultVal // TODO rename back
9292

9393
operator fun set(key: Int, value: Int) {
9494
data[key] = value

src/main/kotlin/imgui/imgui/inputs.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ interface imgui_inputs {
8181

8282
// Expand for touch input
8383
val rectForTouch = Rect(rectClipped.min - style.touchExtraPadding, rectClipped.max + style.touchExtraPadding)
84-
return rectForTouch.contains(IO.mousePos)
84+
return rectForTouch contains IO.mousePos
8585
}
8686

8787
/** shortcut to IO.mousePos provided by user, to be consistent with other calls */

src/main/kotlin/imgui/imgui/internal.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ interface imgui_internal {
238238
fun isClippedEx(bb: Rect, id: Int?, clipEvenWhenLogged: Boolean): Boolean {
239239

240240
val window = currentWindowRead!!
241-
if (!bb.overlaps(window.clipRect))
241+
if (!(bb overlaps window.clipRect))
242242
if (id == null || id != g.activeId)
243243
if (clipEvenWhenLogged || !g.logEnabled)
244244
return true
@@ -453,7 +453,7 @@ interface imgui_internal {
453453
dc.cursorPos.x = (pos.x + dc.indentX + dc.columnsOffsetX).i.f
454454
}
455455

456-
fun pushColumnClipRect(columnIndex: Int = 1) {
456+
fun pushColumnClipRect(columnIndex: Int = -1) {
457457

458458
val window = currentWindowRead!!
459459
val columnIndex = if (columnIndex < 0) window.dc.columnsCurrent else columnIndex
@@ -1566,7 +1566,7 @@ interface imgui_internal {
15661566
val rect = Rect(rectPos + Vec2(0f, bgOffYUp - g.fontSize), rectPos + Vec2(rectSize.x, bgOffYDn))
15671567
val clipRect_ = Rect(clipRect)
15681568
rect.clipWith(clipRect_)
1569-
if (rect.overlaps(clipRect_))
1569+
if (rect overlaps clipRect_)
15701570
drawWindow.drawList.addRectFilled(rect.min, rect.max, bgColor)
15711571
}
15721572
rectPos.x = renderPos.x - renderScroll.x
@@ -1581,7 +1581,7 @@ interface imgui_internal {
15811581
val cursorIsVisible = g.inputTextState.cursorAnim <= 0f || glm.mod(g.inputTextState.cursorAnim, 1.2f) <= 0.8f
15821582
val cursorScreenPos = renderPos + cursorOffset - renderScroll
15831583
val cursorScreenRect = Rect(cursorScreenPos.x, cursorScreenPos.y - g.fontSize + 0.5f, cursorScreenPos.x + 1f, cursorScreenPos.y - 1.5f)
1584-
if (cursorIsVisible && cursorScreenRect.overlaps(Rect(clipRect)))
1584+
if (cursorIsVisible && cursorScreenRect overlaps Rect(clipRect))
15851585
drawWindow.drawList.addLine(cursorScreenRect.min, cursorScreenRect.bl, Col.Text.u32)
15861586

15871587
/* Notify OS of text input position for advanced IME (-1 x offset so that Windows IME can cover our cursor.
@@ -1835,7 +1835,7 @@ interface imgui_internal {
18351835
} else {
18361836
/* We treat ImGuiSetCondition_Once and ImGuiSetCondition_FirstUseEver the same because tree node state
18371837
are not saved persistently. */
1838-
val storedValue = storage.intaaaaaaaaa(id, -1)
1838+
val storedValue = storage.intaaaaaaaaaaa(id, -1)
18391839
if (storedValue == -1) {
18401840
isOpen = g.setNextTreeNodeOpenVal
18411841
storage[id] = isOpen
@@ -1844,7 +1844,7 @@ interface imgui_internal {
18441844
}
18451845
g.setNextTreeNodeOpenCond = 0
18461846
} else
1847-
isOpen = storage.intaaaaaaaaa(id, if (flags has TreeNodeFlags.DefaultOpen) 1 else 0) != 0 // TODO rename back
1847+
isOpen = storage.intaaaaaaaaaaa(id, if (flags has TreeNodeFlags.DefaultOpen) 1 else 0) != 0 // TODO rename back
18481848

18491849
/* When logging is enabled, we automatically expand tree nodes (but *NOT* collapsing headers.. seems like
18501850
sensible behavior).

src/main/kotlin/imgui/imgui/utilities.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ interface imgui_utilities {
3434
fun isItemClicked(mouseButton: Int = 0) = isMouseClicked(mouseButton) && isItemRectHovered()
3535

3636
/** was the last item visible? (aka not out of sight due to clipping/scrolling.) */
37-
val isItemVisible get() = with(currentWindowRead!!) { clipRect.overlaps(dc.lastItemRect) }
37+
val isItemVisible get() = with(currentWindowRead!!) { clipRect overlaps dc.lastItemRect }
3838

3939
val isAnyItemHovered get() = g.hoveredId != 0 || g.hoveredIdPreviousFrame != 0
4040

@@ -79,10 +79,10 @@ interface imgui_utilities {
7979
get() = g.hoveredRootWindow != null && (g.hoveredRootWindow === g.currentWindow!!.rootWindow) && g.hoveredRootWindow!!.isContentHoverable
8080

8181
/** test if rectangle (of given size, starting from cursor position) is visible / not clipped. */
82-
fun isRectVisible(size: Vec2) = with(currentWindowRead!!) { clipRect.overlaps(Rect(dc.cursorPos, dc.cursorPos + size)) }
82+
fun isRectVisible(size: Vec2) = with(currentWindowRead!!) { clipRect overlaps Rect(dc.cursorPos, dc.cursorPos + size) }
8383

8484
/** test if rectangle (in screen space) is visible / not clipped. to perform coarse clipping on user's side. */
85-
fun isRectVisible(rectMin: Vec2, rectMax: Vec2) = currentWindowRead!!.clipRect.overlaps(Rect(rectMin, rectMax))
85+
fun isRectVisible(rectMin: Vec2, rectMax: Vec2) = currentWindowRead!!.clipRect overlaps Rect(rectMin, rectMax)
8686

8787
val time get() = g.time
8888

0 commit comments

Comments
 (0)