Skip to content

[examples] Skip empty areas in tiled texture drawing - #6412

Merged
raysan5 merged 1 commit into
raysan5:masterfrom
yex743055-sudo:fix/tiled-drawing-empty-area
Nov 13, 2026
Merged

raysan5 merged 1 commit into
raysan5:masterfrom
yex743055-sudo:fix/tiled-drawing-empty-area

Conversation

@yex743055-sudo

@yex743055-sudo yex743055-sudo commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

In textures_tiled_drawing, shrinking the client area below 236 px makes the tiling width negative. DrawTexturePro() treats the negative destination size as positive, so the example can draw an extra strip inside the window's right margin.

Skip the tiling pass when its destination width or height is zero or negative.

Related to the example-testing discussion in #5664.

Windows x64, Visual Studio 2022, GLFW: built the example and checked pixels using the same C test before and after the change. A 232 px client width left the margin clear after the fix. Zero-sized destinations remained clear, and positive single-tile, one-row, one-column and restored 800 px cases still rendered. The test also checked a negative destination height.

WSL Ubuntu 24.04, GCC 13.3, PLATFORM_MEMORY: the same eight pixel cases passed after the fix. The narrow-width case uses the computed destination directly on this backend.

@raysan5
raysan5 merged commit 82e087f into raysan5:master Nov 13, 2026
@raysan5

raysan5 commented Nov 13, 2026

Copy link
Copy Markdown
Owner

@yex743055-sudo thanks for the review

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