From fdf2b95fa66a7d248feed9ead19e159faa5e6121 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 27 Nov 2015 12:12:00 +0100 Subject: [PATCH] CLuaInstance::CPictureNew: When dx and dy = 0 then use... ...'NO_SCALE' modus for object creation (icon) - Set Lua api version to 1.15 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/573eb7f7ad61c1a6dfd2a4d8ff7a0d899ffe0a54 Author: Michael Liebmann Date: 2015-11-27 (Fri, 27 Nov 2015) ------------------ This commit was generated by Migit --- src/gui/luainstance.cpp | 5 ++++- src/gui/luainstance.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 61a378d15..7a194de14 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -2684,7 +2684,10 @@ int CLuaInstance::CPictureNew(lua_State *L) CLuaPicture **udata = (CLuaPicture **) lua_newuserdata(L, sizeof(CLuaPicture *)); *udata = new CLuaPicture(); - (*udata)->cp = new CComponentsPicture(x, y, dx, dy, image_name, pw, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_background, (fb_pixel_t)color_shadow, transparency); + if (dx == 0 && dy == 0) /* NO_SCALE */ + (*udata)->cp = new CComponentsPicture(x, y, image_name, pw, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_background, (fb_pixel_t)color_shadow, transparency); + else + (*udata)->cp = new CComponentsPicture(x, y, dx, dy, image_name, pw, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_background, (fb_pixel_t)color_shadow, transparency); (*udata)->parent = pw; luaL_getmetatable(L, "cpicture"); lua_setmetatable(L, -2); diff --git a/src/gui/luainstance.h b/src/gui/luainstance.h index f30fd285d..707850b84 100644 --- a/src/gui/luainstance.h +++ b/src/gui/luainstance.h @@ -34,7 +34,7 @@ extern "C" { #include #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 14 +#define LUA_API_VERSION_MINOR 15 typedef std::pair fontmap_pair_t; typedef std::map fontmap_t;