summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/models/parsetreenode.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-08-09 19:37:23 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-08-09 19:37:23 +0000
commitd1a392a0e95b10fe9603fbd379a70b4cc0ddf22f (patch)
treeb1ce5452aa5578c7cbc5e711373d73b52b797510 /utils/themeeditor/models/parsetreenode.cpp
parent77b682571f80b0aec9a16182600678a1b553a4bb (diff)
downloadrockbox-d1a392a0e95b10fe9603fbd379a70b4cc0ddf22f.tar.gz
rockbox-d1a392a0e95b10fe9603fbd379a70b4cc0ddf22f.tar.bz2
rockbox-d1a392a0e95b10fe9603fbd379a70b4cc0ddf22f.zip
Theme Editor: Co Used a more efficient/less error-prone system for rendering SBS documents underneath WPS documents
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27765 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/models/parsetreenode.cpp')
-rw-r--r--utils/themeeditor/models/parsetreenode.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/utils/themeeditor/models/parsetreenode.cpp b/utils/themeeditor/models/parsetreenode.cpp
index ac2556b17f..9cc73ce1c7 100644
--- a/utils/themeeditor/models/parsetreenode.cpp
+++ b/utils/themeeditor/models/parsetreenode.cpp
@@ -31,6 +31,9 @@
#include <iostream>
#include <cmath>
+#include <cassert>
+
+#include <QDebug>
int ParseTreeNode::openConditionals = 0;
bool ParseTreeNode::breakFlag = false;
@@ -571,9 +574,12 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport,
else if(element->type == CONDITIONAL)
{
int child = evalTag(info, true, element->children_count).toInt();
- if(child < children.count())
+ int max = children.count() - element->params_count;
+ if(child < max)
+ {
children[element->params_count + child]
->render(info, viewport, true);
+ }
}
else if(element->type == LINE_ALTERNATOR)
{
@@ -856,8 +862,6 @@ bool ParseTreeNode::execTag(const RBRenderInfo& info, RBViewport* viewport)
int height = element->params[3].data.number;
QString action(element->params[4].data.text);
RBTouchArea* temp = new RBTouchArea(width, height, action, info);
- x += viewport->x();
- y += viewport->y();
temp->setPos(x, y);
return true;
}
@@ -914,10 +918,7 @@ bool ParseTreeNode::execTag(const RBRenderInfo& info, RBViewport* viewport)
case '\0':
/* %X */
filename = QString(element->params[0].data.text);
- if(info.sbsScreen() && info.screen()->parentItem())
- info.sbsScreen()->setBackdrop(filename);
- else
- info.screen()->setBackdrop(filename);
+ info.screen()->setBackdrop(filename);
return true;
}