Skip to content

Fixed assertion fail on resizing#2433

Open
oleg68 wants to merge 1 commit intoGrandOrgue:masterfrom
oleg68:bugfix/asset-image
Open

Fixed assertion fail on resizing#2433
oleg68 wants to merge 1 commit intoGrandOrgue:masterfrom
oleg68:bugfix/asset-image

Conversation

@oleg68
Copy link
Contributor

@oleg68 oleg68 commented Mar 4, 2026

Earlier when resising a panel lower it's original size there were assertion failed messages "Image is not valid".

The reason was that some elements had some size equal to 1 pixel. When downscaling the image, the size became 0 that made the bitmap as invalid.

This PR introduces lots of validations when scaling the bitmap. If some size becomes 0, then the GOBitmap instance is marked as invalid, and GetResultBitmap returns nullptr instead of invalid bitmap instance, and GODC::DrawBitmap does not try to draw it.

@oleg68 oleg68 requested review from larspalo and rousseldenis March 4, 2026 18:52
@larspalo
Copy link
Contributor

@oleg68 I'm not yet certain of how this approach will perform and affect some sample sets. There might be certain tricks done with transparent 1px images in a few sample sets. I'll need to test this carefully to see if there are side effects caused by it.

The scaling (both down and up) layout mechanism need a bit of re-designing anyway (for instance to assure that the keyboard layout always will be sane without disturbing blank spaces). Maybe rounding up and never going below 1 px might be a better idea than invalidating...

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.

2 participants