Skip to content

Fix items specifying height-only or width-only dimension having wrong proportions - #28

Merged
emosaru merged 1 commit into
avaloniafrom
fix/issue-4-item-dimensions
Apr 11, 2026
Merged

Fix items specifying height-only or width-only dimension having wrong proportions#28
emosaru merged 1 commit into
avaloniafrom
fix/issue-4-item-dimensions

Conversation

@emosaru

@emosaru emosaru commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes Items specifying height instead of width has some display issues #4, Cascading margin issue? (Map getting misaligned with background item grid) #7
  • IconDimensionMultiConverter now accepts three bindings: this dimension, the other dimension, and the image source. When only one dimension is specified, the missing dimension is derived from the image aspect ratio rather than falling back to the raw pixel size.
  • Fixed the guard condition from > 0 to >= 0 so an explicit zero-dimension is honoured and doesn't fall into the proportional-scaling path.
  • Added FallbackValue=False to BadgeText visibility binding to prevent flicker during binding initialisation.
  • Changed Button template inner Grid background from Transparent to {x:Null} to avoid a background that unnecessarily consumes hit-test area.

Test plan

  • Load CodeTracker, open Key Tracker variant
  • Verify Prize Shuffle icon displays correctly (overlaid on the 2x2 dungeon grid)
  • Verify Modes popout menu displays correctly
  • Verify items that specify only h (height) render at correct proportions instead of being stretched to square
  • Verify items that specify only w (width) still render correctly

🤖 Generated with Claude Code

… proportions

Fixes #4, #7.

- IconDimensionMultiConverter now accepts three bindings (this dim,
  other dim, image source). When only one dimension is specified, the
  other is derived from the image aspect ratio instead of falling back
  to the raw pixel size.
- Fixed the >= 0 guard so an explicit zero-dimension is honoured and
  does not trigger the proportional-scaling path.
- Added FallbackValue=False to BadgeText visibility so it does not
  flicker visible during binding initialisation.
- Changed Button template inner Grid background from Transparent to
  {x:Null} to avoid a background that consumes hit-test area.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@emosaru
emosaru requested a review from a team April 11, 2026 19:39
@emosaru
emosaru merged commit 690e4b9 into avalonia Apr 11, 2026
3 checks passed
@emosaru
emosaru deleted the fix/issue-4-item-dimensions branch April 11, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant