Make DividerContainer respect the ImGui draw cursor#223
Merged
Conversation
Tick() previously hard-positioned the container at GetWindowPos() + WindowPadding and sized it to the full GetWindowSize(), so it always filled the host window from its top-left corner regardless of where the layout cursor was. This made it impossible to draw content above the container or place it anywhere but the top of a window. Lay the container out from GetCursorScreenPos() using GetContentRegionAvail() instead, so it starts at the current draw cursor and occupies the remaining content region. Behavior is unchanged when the container is the first thing drawn in a window (the two values are equivalent in that case). https://claude.ai/code/session_014DX1uH9hzVfcrtYG9euNpA
The ktsu.Sdk analyzer (KTSU0005) failed the build because three PackageVersion entries were not referenced by any project: ktsu.RoundTripStringJsonConverter, ktsu.FuzzySearch, and Microsoft.Testing.Extensions.CodeCoverage. Remove them so central package management only lists packages that are actually consumed. https://claude.ai/code/session_014DX1uH9hzVfcrtYG9euNpA
The ktsu.Sdk analyzer (KTSU0006) requires that any package whose types are used directly is referenced explicitly rather than pulled in transitively. - ImGui.App: reference the Silk.NET sub-packages it uses directly (Silk.NET.Core, Silk.NET.Maths, Silk.NET.Input.Common, Silk.NET.Windowing.Common) in the non-iOS item group, since that code is excluded or #if !IOS-gated on iOS. Add matching PackageVersion entries for central package management. - ImGui.Widgets: reference ktsu.Extensions, ktsu.ScopedAction and ktsu.Semantics.Strings, which it uses in DividerContainer, ScopedDisable and Combo respectively. https://claude.ai/code/session_014DX1uH9hzVfcrtYG9euNpA
The KTSU0006 analyzer flagged the demo projects for using types from transitive packages. Reference them explicitly: - ImGuiWidgetsDemo: Hexa.NET.ImGui, ktsu.Semantics.Paths, ktsu.Semantics.Strings, ktsu.TextFilter - ImGuiPopupsDemo: Hexa.NET.ImGui, ktsu.Semantics.Strings - ImGuiStylerDemo: Hexa.NET.ImGui, ktsu.ThemeProvider ImGuiAppDemo already declared all of its direct dependencies. https://claude.ai/code/session_014DX1uH9hzVfcrtYG9euNpA
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
DividerContainer.Tick()previously hard-positioned the container atGetWindowPos() + WindowPaddingand sized it to the fullGetWindowSize(), so it always filled the host window from its top-left corner — ignoring the current ImGui layout/draw cursor. This made it impossible to draw content above the container or place it anywhere but the top of a window.This change lays the container out from
GetCursorScreenPos()usingGetContentRegionAvail(), so it starts at the current draw cursor and occupies the remaining content region.Behavior
GetCursorScreenPos() == GetWindowPos() + WindowPaddingandGetContentRegionAvail() == GetWindowSize() - 2*WindowPadding), so existing usage (e.g. the demo, where the container fills the whole window) is unchanged.Changes
ImGui.Widgets/DividerContainer.cs: replace window-relative origin/size with cursor-relative origin (GetCursorScreenPos) and available-region size (GetContentRegionAvail).Testing
Could not run
dotnet build/dotnet testin this environment: the only installed SDK is 10.0.108, butktsu.Sdk.Analyzers2.9.0 requires Roslyn 5.3 (SDK 10.0.3xx), so every project fails withCS9057regardless of this change, and the matching SDK can't be downloaded due to the network policy. The change is a small, mechanical substitution of the layout origin/size sources.https://claude.ai/code/session_014DX1uH9hzVfcrtYG9euNpA
Generated by Claude Code