mirror of
https://github.com/raysan5/raygui.git
synced 2026-01-28 09:49:18 -05:00
Avoid using hardcoded values in whitechar (#273)
Proposed change avoids hardcoded values and creates white rectangle exaclty like in rcore.
This commit is contained in:
@ -3632,9 +3632,10 @@ void GuiLoadStyleDefault(void)
|
|||||||
// Setup default raylib font
|
// Setup default raylib font
|
||||||
guiFont = GetFontDefault();
|
guiFont = GetFontDefault();
|
||||||
|
|
||||||
// Setup default raylib font rectangle
|
// NOTE: Default raylib font character 95 is a white square
|
||||||
Rectangle whiteChar = { 41, 46, 2, 8 };
|
Rectangle whiteChar = guiFont.recs[95];
|
||||||
SetShapesTexture(guiFont.texture, whiteChar);
|
// NOTE: We set up a 1px padding on char rectangle to avoid pixel bleeding on MSAA filtering
|
||||||
|
SetShapesTexture(guiFont.texture, (Rectangle){ whiteChar.x + 1, whiteChar.y + 1, whiteChar.width - 2, whiteChar.height - 2 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user