Skip to content

Commit 6e3f1d7

Browse files
committed
- layout
- fixed bug in `::listBox`
1 parent d4d38c8 commit 6e3f1d7

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

core/src/main/kotlin/imgui/api/widgetsListBoxes.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ interface widgetsListBoxes {
101101
val itemsCount = items.size
102102

103103
// Calculate size from "height_in_items"
104-
val heightInItems = if (heightInItems_ < 0) heightInItems_ else itemsCount min 7
104+
val heightInItems = if (heightInItems_ < 0) itemsCount min 7 else heightInItems_
105105
val heightInItemsF = heightInItems + 0.25f
106106
val size = Vec2(0f, floor(textLineHeightWithSpacing * heightInItemsF + g.style.framePadding.y * 2f))
107107

core/src/main/kotlin/imgui/demo/ShowDemoWindowWidgets.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ object ShowDemoWindowWidgets {
429429
// See "List boxes" section for examples of how to use the more flexible BeginListBox()/EndListBox() api.
430430
val items = arrayOf("Apple", "Banana", "Cherry", "Kiwi", "Mango", "Orange", "Pineapple", "Strawberry", "Watermelon")
431431
listBox("listbox", ::itemCurrent0, items, 4)
432-
433432
sameLine(); helpMarker("Using the simplified one-liner ListBox API here.\nRefer to the \"List boxes\" section below for an explanation of how to use the more flexible and general BeginListBox/EndListBox API.")
434433
}
435434
}

0 commit comments

Comments
 (0)