From 4666d83beb95bc261da08db5fa10e114a4e60912 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sat, 21 May 2016 15:24:11 -0300 Subject: [PATCH] Fixed ImageData:mapPixel again, for non-JIT platforms this time. --HG-- branch : minor --- src/modules/image/wrap_ImageData.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/image/wrap_ImageData.cpp b/src/modules/image/wrap_ImageData.cpp index 0a5de3afc..dea5ffaed 100644 --- a/src/modules/image/wrap_ImageData.cpp +++ b/src/modules/image/wrap_ImageData.cpp @@ -165,10 +165,10 @@ int w_ImageData__mapPixelUnsafe(lua_State *L) lua_pushnumber(L, x); lua_pushnumber(L, y); pixel c = t->getPixel(x, y); - lua_pushnumber(L, c.r); - lua_pushnumber(L, c.g); - lua_pushnumber(L, c.b); - lua_pushnumber(L, c.a); + lua_pushnumber(L, c.r / 255.0); + lua_pushnumber(L, c.g / 255.0); + lua_pushnumber(L, c.b / 255.0); + lua_pushnumber(L, c.a / 255.0); lua_call(L, 6, 4); // If we used luaL_checkX / luaL_optX then we would get messy error