1
0
Fork 0
forked from len0rd/rockbox

Theme Editor: Implemented negative x/y/w/h values in viewport declarations

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27205 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Bieber 2010-07-01 02:07:41 +00:00
parent 82618e82e6
commit 8cd51a70c5

View file

@ -93,17 +93,25 @@ RBViewport::RBViewport(skin_element* node, const RBRenderInfo& info)
} }
/* Now we grab the info common to all viewports */ /* Now we grab the info common to all viewports */
x = node->params[param++].data.numeric; x = node->params[param++].data.numeric;
if(x < 0)
x = info.screen()->boundingRect().right() + x;
y = node->params[param++].data.numeric; y = node->params[param++].data.numeric;
if(y < 0)
y = info.screen()->boundingRect().bottom() + y;
if(node->params[param].type == skin_tag_parameter::DEFAULT) if(node->params[param].type == skin_tag_parameter::DEFAULT)
w = info.screen()->getWidth() - x; w = info.screen()->getWidth() - x;
else else
w = node->params[param].data.numeric; w = node->params[param].data.numeric;
if(w < 0)
w = info.screen()->getWidth() + w - x;
if(node->params[++param].type == skin_tag_parameter::DEFAULT) if(node->params[++param].type == skin_tag_parameter::DEFAULT)
h = info.screen()->getHeight() - y; h = info.screen()->getHeight() - y;
else else
h = node->params[param].data.numeric; h = node->params[param].data.numeric;
if(h < 0)
h = info.screen()->getHeight() + h - y;
setPos(x, y); setPos(x, y);
size = QRectF(0, 0, w, h); size = QRectF(0, 0, w, h);