diff options
Diffstat (limited to 'utils/themeeditor/models/parsetreenode.cpp')
-rw-r--r-- | utils/themeeditor/models/parsetreenode.cpp | 15 |
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 | ||
35 | int ParseTreeNode::openConditionals = 0; | 38 | int ParseTreeNode::openConditionals = 0; |
36 | bool ParseTreeNode::breakFlag = false; | 39 | bool 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 | ||