オーバレイ表示の前後関係の安定化#436
Merged
Merged
Conversation
Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] テキスト矩形を小さい順にソートして表示する
Add ZOrder property and area-based sorting for text rectangles
Aug 17, 2025
Freeesia
requested changes
Aug 18, 2025
Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
Owner
|
@copilot |
Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
Contributor
Author
要求された変更を実装しました。TextRect.ZOrderプロパティを削除し、代わりにAreaToZIndexConverterを作成して面積ベースのZIndex計算を行うようにしました。 変更内容:
これにより、小さい面積のテキストほど前面に表示されるようになります。 コミット: 10f05d6 |
Copilot
AI
changed the title
Add ZOrder property and area-based sorting for text rectangles
Implement area-based Z-ordering using WPF converter for text rectangles
Aug 18, 2025
Freeesia
approved these changes
Aug 19, 2025
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.
This PR implements a solution to prevent large text rectangles from obscuring smaller ones by using a WPF value converter to calculate Z-index based on area. Small text elements like tooltips and buttons will now always appear in front of larger background text.
Implementation Details
Area-Based ZIndex Converter
Created
AreaToZIndexConverterthat calculates the negative area (Width × Height) as the ZIndex value:WPF Template Integration
Updated the XAML template to bind
Panel.ZIndexdirectly to the converter:Removed Previous ZOrder Implementation
ZOrderproperty fromTextRectrecordMainViewModelBase.CreateTextOverlayAsync()Example Behavior
The converter automatically calculates Z-index values based on area:
This approach eliminates the need for explicit sorting and ZOrder management while achieving the same visual result through WPF's native Z-index system.
Fixes #435.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.