Skip to content

Commit a06b409

Browse files
committed
fixed submenu positions
1 parent dfc2335 commit a06b409

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

imgui.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@ Pos=60,60
1818
Size=400.0,400.0
1919
Collapsed=0
2020

21+
[Another Window]
22+
Pos=606,53
23+
Size=215.0,48.0
24+
Collapsed=0
25+

src/main/kotlin/imgui/font.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class FontConfig {
4242
* font. If enabled, you can set OversampleH/V to 1. */
4343
var pixelSnapH = false
4444
/** Extra spacing (in pixels) between glyphs. Only X axis is supported for now. */
45-
var glyphExtraSpacing = Vec2(1f, 0f)
45+
var glyphExtraSpacing = Vec2()
4646
/** Offset all glyphs from this font input. */
4747
var glyphOffset = Vec2()
4848
/** Pointer to a user-provided list of Unicode range (2 value per range, values are inclusive, zero-terminated

src/main/kotlin/imgui/imgui/menus.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ interface imgui_menus {
120120

121121
val pressed: Boolean
122122
var menuIsOpen = isPopupOpen(id)
123+
if(menuIsOpen && label[0] == 'O')
124+
println()
123125
val menusetIsOpen = window.flags hasnt Wf.Popup && g.openPopupStack.size > g.currentPopupStack.size &&
124126
g.openPopupStack[g.currentPopupStack.size].parentMenuSet == window.getId("##menus")
125127
val backedNavWindow = g.navWindow

src/main/kotlin/imgui/imgui/window.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ interface imgui_window {
7070
createNewWindow(name, sizeOnFirstUse, flags)
7171
}
7272

73+
if(name.startsWith("##m"))
74+
println()
75+
7376
val currentFrame = g.frameCount
7477
val firstBeginOfTheFrame = window.lastFrameActive != currentFrame
7578
if (firstBeginOfTheFrame)
@@ -105,7 +108,7 @@ interface imgui_window {
105108
if (window.appearing)
106109
window.setWindowPosAllowFlags = window.setWindowPosAllowFlags or Cond.Appearing
107110
windowPosSetByApi = window.setWindowPosAllowFlags has g.setNextWindowPosCond
108-
if (windowPosSetByApi && g.setNextWindowPosPivot.lengthSqr < 0.00001f) {
111+
if (windowPosSetByApi && g.setNextWindowPosPivot.lengthSqr > 0.00001f) {
109112
/* May be processed on the next frame if this is our first frame and we are measuring size
110113
FIXME: Look into removing the branch so everything can go through this same code path for consistency. */
111114
window.setWindowPosVal put g.setNextWindowPosVal
@@ -200,14 +203,14 @@ interface imgui_window {
200203

201204
// Save contents size from last frame for auto-fitting (unless explicitly specified)
202205
window.sizeContents.x = (
203-
if (window.sizeContentsExplicit.x != 0.0f) window.sizeContentsExplicit.x
206+
if (window.sizeContentsExplicit.x != 0f) window.sizeContentsExplicit.x
204207
else (
205-
if (windowIsNew) 0.0f
208+
if (windowIsNew) 0f
206209
else window.dc.cursorMaxPos.x - window.pos.x) + window.scroll.x).i.f
207210
window.sizeContents.y = (
208-
if (window.sizeContentsExplicit.y != 0.0f) window.sizeContentsExplicit.y
211+
if (window.sizeContentsExplicit.y != 0f) window.sizeContentsExplicit.y
209212
else (
210-
if (windowIsNew) 0.0f
213+
if (windowIsNew) 0f
211214
else window.dc.cursorMaxPos.y - window.pos.y) + window.scroll.y).i.f
212215

213216
// Hide popup/tooltip window when first appearing while we measure size (because we recycle them)

0 commit comments

Comments
 (0)