mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Clamp color arguments to [0, 1] in cases where we don’t support values outside of that range internally.
--HG-- branch : minor
This commit is contained in:
@@ -403,11 +403,18 @@ std::vector<Font::DrawCommand> Font::generateVertices(const ColoredCodepoints &c
|
||||
|
||||
if (curcolori + 1 < ncolors && codepoints.colors[curcolori + 1].index == i)
|
||||
{
|
||||
Colorf color = gammaCorrectColor(codepoints.colors[++curcolori].color);
|
||||
color *= linearconstantcolor;
|
||||
unGammaCorrectColor(color);
|
||||
Colorf c = codepoints.colors[++curcolori].color;
|
||||
|
||||
curcolor = toColor(color);
|
||||
c.r = std::min(std::max(c.r, 0.0f), 1.0f);
|
||||
c.g = std::min(std::max(c.g, 0.0f), 1.0f);
|
||||
c.b = std::min(std::max(c.b, 0.0f), 1.0f);
|
||||
c.a = std::min(std::max(c.a, 0.0f), 1.0f);
|
||||
|
||||
gammaCorrectColor(c);
|
||||
c *= linearconstantcolor;
|
||||
unGammaCorrectColor(c);
|
||||
|
||||
curcolor = toColor(c);
|
||||
}
|
||||
|
||||
if (g == '\n')
|
||||
|
||||
Reference in New Issue
Block a user