diff options
| author | Ray <[email protected]> | 2023-09-04 18:43:25 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2023-09-04 18:43:25 +0200 |
| commit | bdda1efd44d7a1dce1ce5ad03f7de14370642807 (patch) | |
| tree | 48c8406979d1e782904de5561407ec2232a6d092 /src | |
| parent | 8a82e17a794ac5ac8c073f9a96cf5e4ae0c1ebf2 (diff) | |
| download | raylib-bdda1efd44d7a1dce1ce5ad03f7de14370642807.tar.gz raylib-bdda1efd44d7a1dce1ce5ad03f7de14370642807.zip | |
Fix #3247
Diffstat (limited to 'src')
| -rw-r--r-- | src/rcore.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/rcore.c b/src/rcore.c index 912f85c0..67907c36 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -887,9 +887,19 @@ void InitWindow(int width, int height, const char *title) // WARNING: External function: Module required: rtext LoadFontDefault(); #if defined(SUPPORT_MODULE_RSHAPES) + // Set font white rectangle for shapes drawing, so shapes and text can be batched together + // WARNING: rshapes module is required, if not available, default internal white rectangle is used Rectangle rec = GetFontDefault().recs[95]; - // NOTE: We set up a 1px padding on char rectangle to avoid pixel bleeding on MSAA filtering - SetShapesTexture(GetFontDefault().texture, (Rectangle){ rec.x + 1, rec.y + 1, rec.width - 2, rec.height - 2 }); // WARNING: Module required: rshapes + if (CORE.Window.flags & FLAG_MSAA_4X_HINT) + { + // NOTE: We try to maxime rec padding to avoid pixel bleeding on MSAA filtering + SetShapesTexture(GetFontDefault().texture, (Rectangle){ rec.x + 2, rec.y + 2, 1, 1 }); + } + else + { + // NOTE: We set up a 1px padding on char rectangle to avoid pixel bleeding + SetShapesTexture(GetFontDefault().texture, (Rectangle){ rec.x + 1, rec.y + 1, rec.width - 2, rec.height - 2 }); + } #endif #else #if defined(SUPPORT_MODULE_RSHAPES) |
