Skip to content

Commit

Permalink
- fixed bug in endChild and navMoveRequestApplyResult
Browse files Browse the repository at this point in the history
- layout
  • Loading branch information
elect86 committed Jun 26, 2023
1 parent a408a37 commit 05618ba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/src/main/kotlin/imgui/api/childWindows.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ interface childWindows {

// But when flattened we directly reach items, adjust active layer mask accordingly
if (window.flags has Wf._NavFlattened)
parentWindow.dc.navLayersActiveMaskNext /= window.dc.navLayersActiveMaskNext
parentWindow.dc.navLayersActiveMaskNext = parentWindow.dc.navLayersActiveMaskNext or window.dc.navLayersActiveMaskNext
}
if (g.hoveredWindow === window)
g.lastItemData.statusFlags = g.lastItemData.statusFlags or ItemStatusFlag.HoveredWindow
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package imgui.internal.api

import glm_.i
import glm_.vec2.Vec2
import imgui.*
import imgui.ImGui.clearActiveID
import imgui.ImGui.rectRelToAbs
Expand Down Expand Up @@ -181,7 +182,7 @@ internal interface gamepadKeyboardNavigation {

// Apply new NavID/Focus
IMGUI_DEBUG_LOG_NAV("[nav] NavMoveRequest: result NavID 0x%08X in Layer ${g.navLayer.ordinal} Window \"${window.name}\"", result.id) // [JVM] window *is* g.navWindow!!
val preferredScoringPosRel = g.navWindow!!.rootWindowForNav!!.navPreferredScoringPosRel[g.navLayer.ordinal]
val preferredScoringPosRel = Vec2(g.navWindow!!.rootWindowForNav!!.navPreferredScoringPosRel[g.navLayer.ordinal])
setNavID(result.id, g.navLayer, result.focusScopeId, result.rectRel)

// Restore last preferred position for current axis
Expand Down
5 changes: 2 additions & 3 deletions core/src/main/kotlin/imgui/statics/navigation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -783,10 +783,9 @@ fun navScoreItem(result: NavItemData): Boolean {
val window = g.currentWindow!!
if (g.navLayer != window.dc.navLayerCurrent) return false

// Current modified source rect (NB: we've applied max.x = min.x in navUpdate() to inhibit the effect of having varied item width)
val curr = Rect(g.navScoringRect)
// FIXME: Those are not good variables names
val cand = g.lastItemData.navRect // Current item nav rectangle
val cand = Rect(g.lastItemData.navRect) // Current item nav rectangle
val curr = g.navScoringRect // Current modified source rect (NB: we've applied Max.x = Min.x in NavUpdate() to inhibit the effect of having varied item width)
g.navScoringDebugCount++

// When entering through a NavFlattened border, we consider child window items as fully clipped for scoring
Expand Down

0 comments on commit 05618ba

Please sign in to comment.