summaryrefslogtreecommitdiff
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.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 @@
31 31
32#include <iostream> 32#include <iostream>
33#include <cmath> 33#include <cmath>
34#include <cassert>
35
36#include <QDebug>
34 37
35int ParseTreeNode::openConditionals = 0; 38int ParseTreeNode::openConditionals = 0;
36bool ParseTreeNode::breakFlag = false; 39bool ParseTreeNode::breakFlag = false;
@@ -571,9 +574,12 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport,
571 else if(element->type == CONDITIONAL) 574 else if(element->type == CONDITIONAL)
572 { 575 {
573 int child = evalTag(info, true, element->children_count).toInt(); 576 int child = evalTag(info, true, element->children_count).toInt();
574 if(child < children.count()) 577 int max = children.count() - element->params_count;
578 if(child < max)
579 {
575 children[element->params_count + child] 580 children[element->params_count + child]
576 ->render(info, viewport, true); 581 ->render(info, viewport, true);
582 }
577 } 583 }
578 else if(element->type == LINE_ALTERNATOR) 584 else if(element->type == LINE_ALTERNATOR)
579 { 585 {
@@ -856,8 +862,6 @@ bool ParseTreeNode::execTag(const RBRenderInfo& info, RBViewport* viewport)
856 int height = element->params[3].data.number; 862 int height = element->params[3].data.number;
857 QString action(element->params[4].data.text); 863 QString action(element->params[4].data.text);
858 RBTouchArea* temp = new RBTouchArea(width, height, action, info); 864 RBTouchArea* temp = new RBTouchArea(width, height, action, info);
859 x += viewport->x();
860 y += viewport->y();
861 temp->setPos(x, y); 865 temp->setPos(x, y);
862 return true; 866 return true;
863 } 867 }
@@ -914,10 +918,7 @@ bool ParseTreeNode::execTag(const RBRenderInfo& info, RBViewport* viewport)
914 case '\0': 918 case '\0':
915 /* %X */ 919 /* %X */
916 filename = QString(element->params[0].data.text); 920 filename = QString(element->params[0].data.text);
917 if(info.sbsScreen() && info.screen()->parentItem()) 921 info.screen()->setBackdrop(filename);
918 info.sbsScreen()->setBackdrop(filename);
919 else
920 info.screen()->setBackdrop(filename);
921 return true; 922 return true;
922 } 923 }
923 924