Skip to content
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

[Bug]: KryptonButton - Image stretches with increased border rounding #739

Closed
MattH-Work opened this issue Jun 9, 2022 · 5 comments
Closed
Labels
bug Something isn't working fixed This issue has been fixed.

Comments

@MattH-Work
Copy link

Windows 10
Visual Studio (VB) 2019
.Net 4.8
Krypton Toolkit 65.22.6.15

With border rounding set to above '7', image applied to button streches to full width of control, unless we increase control height
To keep consistent control sizes, can the strech be avoided?
Is it possible to shift the image a few pixels to the right?

image

@MattH-Work MattH-Work added the bug Something isn't working label Jun 9, 2022
@Smurf-IV
Copy link
Member

Smurf-IV commented Jun 9, 2022

I think (Just speculating) that there is not enough "room" left for the text to be drawn, so the image is then given full access to the width of the area.

Rounding effectively takes a little away from the drawing area, and then also applies "Extra" to the outside as well, so it effectively adds to the "Dead space" around the image and text.
This is one of the things that MS are driving towards for .Net Core 3 onwards anyway ! "https://docs.microsoft.com/en-us/dotnet/core/compatibility/winforms#change-description"
So all controls should be bigger by default #615

@Smurf-IV
Copy link
Member

Smurf-IV commented Jun 9, 2022

Proposed fix.. Make the Preferred size ignore whether text can be drawn fully, and force clipping to be used.

@Smurf-IV Smurf-IV self-assigned this Jun 11, 2022
@Smurf-IV Smurf-IV added the under investigation This bug/issue is currently under investigation. label Jun 11, 2022
@Smurf-IV
Copy link
Member

Proposed fix.. Make the Preferred size ignore whether text can be drawn fully, and force clipping to be used.

That will not work !
As the following code gets "Triggered" when the available height left after rounding is less than the height of the image:
image

Resulting in an image taking the full width.
Not sure why this was done.

@Smurf-IV
Copy link
Member

Not sure why this was done.

It is to allow a very large image to be scaled down !!
Doesn't seem to work as expected tho !

@Smurf-IV
Copy link
Member

Fixed:
image

Note: All the images are taller than the available space, and the Blue icon is 128 wide, so is wider as well

PR Coming soon.

Smurf-IV added a commit that referenced this issue Jun 12, 2022
…he image.

Ensure that the ratio is applied in the correct direction

#739
@Smurf-IV Smurf-IV removed their assignment Jun 12, 2022
@Smurf-IV Smurf-IV added fixed This issue has been fixed. and removed under investigation This bug/issue is currently under investigation. labels Jun 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed This issue has been fixed.
Projects
None yet
Development

No branches or pull requests

2 participants