mirror of
https://github.com/love2d/love.git
synced 2026-08-14 01:20:56 +02:00
Clamp all color arguments to [0, 1] in cases where values outside that range don't make sense (fixed-point color values & sRGB colors). Closes issue #1315.
--HG-- branch : minor
This commit is contained in:
@@ -2445,10 +2445,10 @@ int w_points(lua_State *L)
|
||||
positions[i].x = luax_checkfloat(L, -6);
|
||||
positions[i].y = luax_checkfloat(L, -5);
|
||||
|
||||
colors[i].r = (float) luaL_optnumber(L, -4, 1.0);
|
||||
colors[i].g = (float) luaL_optnumber(L, -3, 1.0);
|
||||
colors[i].b = (float) luaL_optnumber(L, -2, 1.0);
|
||||
colors[i].a = (float) luaL_optnumber(L, -1, 1.0);
|
||||
colors[i].r = (float) luax_optnumberclamped01(L, -4, 1.0);
|
||||
colors[i].g = (float) luax_optnumberclamped01(L, -3, 1.0);
|
||||
colors[i].b = (float) luax_optnumberclamped01(L, -2, 1.0);
|
||||
colors[i].a = (float) luax_optnumberclamped01(L, -1, 1.0);
|
||||
|
||||
lua_pop(L, 7);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user