Skip to content

Comments

[Renderers/Raylib] Fix element float distortion#430

Merged
nicbarker merged 1 commit intonicbarker:mainfrom
rootBrz:main
Jun 5, 2025
Merged

[Renderers/Raylib] Fix element float distortion#430
nicbarker merged 1 commit intonicbarker:mainfrom
rootBrz:main

Conversation

@rootBrz
Copy link
Contributor

@rootBrz rootBrz commented Jun 3, 2025

Raylib doesn't seem to handle subpixel rendering well, so when x, y, width, or height values aren't integers, it can distort the rendered output. Happens with images, and much more frequently with elements that have corner radius.
Simple rounding or casting to int fix the problem.

Example below

Distorted:
distorted

Fixed:
fixed

@nicbarker
Copy link
Owner

Great catch, thank you!

@nicbarker nicbarker merged commit 5849139 into nicbarker:main Jun 5, 2025
3 checks passed
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