CLuaInstance: Fix commit e85f64d733

- Use return value from checkMagicMask() for color
This commit is contained in:
M. Liebmann
2016-01-01 14:41:53 +01:00
parent 6801bf215e
commit a7790ce049
4 changed files with 17 additions and 17 deletions

View File

@@ -108,9 +108,9 @@ int CLuaInstCCPicture::CCPictureNew(lua_State *L)
tableLookup(L, "color_shadow", color_shadow);
tableLookup(L, "transparency", transparency);
checkMagicMask(color_frame);
checkMagicMask(color_background);
checkMagicMask(color_shadow);
color_frame = checkMagicMask(color_frame);
color_background = checkMagicMask(color_background);
color_shadow = checkMagicMask(color_shadow);
CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL;

View File

@@ -111,10 +111,10 @@ int CLuaInstCCText::CCTextNew(lua_State *L)
tableLookup(L, "color_body", color_body);
tableLookup(L, "color_shadow", color_shadow);
checkMagicMask(color_text);
checkMagicMask(color_frame);
checkMagicMask(color_body);
checkMagicMask(color_shadow);
color_text = checkMagicMask(color_text);
color_frame = checkMagicMask(color_frame);
color_body = checkMagicMask(color_body);
color_shadow = checkMagicMask(color_shadow);
if (!tmpMode.empty()) {
table_key txt_align[] = {

View File

@@ -104,9 +104,9 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L)
tableLookup(L, "btnYellow", btnYellow);
tableLookup(L, "btnBlue", btnBlue);
checkMagicMask(color_frame);
checkMagicMask(color_body);
checkMagicMask(color_shadow);
color_frame = checkMagicMask(color_frame);
color_body = checkMagicMask(color_body);
color_shadow = checkMagicMask(color_shadow);
bool show_header = true;
if (!tableLookup(L, "show_header", show_header)) {
@@ -227,15 +227,15 @@ int CLuaInstCCWindow::CCWindowSetWindowColor(lua_State *L)
lua_Unsigned color;
if (tableLookup(L, "color_frame" , color)) {
checkMagicMask(color);
color = checkMagicMask(color);
D->w->setColorFrame(color);
}
if (tableLookup(L, "color_body" , color)) {
checkMagicMask(color);
color = checkMagicMask(color);
D->w->setColorBody(color);
}
if (tableLookup(L, "color_shadow" , color)) {
checkMagicMask(color);
color = checkMagicMask(color);
D->w->setColorShadow(color);
}

View File

@@ -768,7 +768,7 @@ int CLuaInstance::PaintBox(lua_State *L)
w = W->fbwin->dx - x;
if (h < 0 || y + h > W->fbwin->dy)
h = W->fbwin->dy - y;
checkMagicMask(c);
c = checkMagicMask(c);
W->fbwin->paintBoxRel(x, y, w, h, c, radius, corner);
return 0;
}
@@ -791,7 +791,7 @@ int CLuaInstance::paintHLineRel(lua_State *L)
y = 0;
if (dx < 0 || x + dx > W->fbwin->dx)
dx = W->fbwin->dx - x;
checkMagicMask(c);
c = checkMagicMask(c);
W->fbwin->paintHLineRel(x, dx, y, c);
return 0;
}
@@ -814,7 +814,7 @@ int CLuaInstance::paintVLineRel(lua_State *L)
y = 0;
if (dy < 0 || y + dy > W->fbwin->dy)
dy = W->fbwin->dy - y;
checkMagicMask(c);
c = checkMagicMask(c);
W->fbwin->paintVLineRel(x, y, dy, c);
return 0;
}
@@ -885,7 +885,7 @@ int CLuaInstance::RenderString(lua_State *L)
if (rwidth < w)
x += (w - rwidth) / 2;
}
checkMagicMask(c);
c = checkMagicMask(c);
if (boxh > -1) /* if boxh < 0, don't paint string */
W->fbwin->RenderString(font, x, y, w, text, c, boxh);
lua_pushinteger(L, rwidth); /* return renderwidth */