Skip to content

Add RectangleSkin::minSize #1317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 11, 2025
Merged

Add RectangleSkin::minSize #1317

merged 4 commits into from
Jul 11, 2025

Conversation

DanRStevens
Copy link
Collaborator

Ensure a RectangleSkin meets a certain minimum size before trying to draw it.

The corner images are always drawn at their natural size, without any kind of clipping or stretching. If the draw rect isn't at least big enough for these images, it will either draw outside of the given bounds, or draw over opposite corner images. Either way the result won't look good.

Convert Rectangle parameter BaseType from float to int. All uses pass in int based Rectangle instances, and really int is the only type that really makes sense for this class. All the Image components have int based sizes.

Related:

This is always used with `int` based `Rectangle` in downstream OPHD. Indeed, it makes the most sense to use `int` values with this class. It uses `Image`, which has `int` based `size` values.
The corner images are always unconditionally drawn full size. If the draw `rect` wasn't at least big enough for the corner images, then `RectangleSkin` would draw outside of the bounds set.
@DanRStevens DanRStevens merged commit decb828 into main Jul 11, 2025
8 checks passed
@DanRStevens DanRStevens deleted the rectangleSkinSize branch July 11, 2025 20:37
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