Theme Editor: Renderer now correctly handles special case with only one branch in a conditional
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27609 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
85040111fe
commit
b22077cd60
1 changed files with 5 additions and 1 deletions
|
@ -560,7 +560,9 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport,
|
|||
else if(element->type == CONDITIONAL)
|
||||
{
|
||||
int child = evalTag(info, true, element->children_count).toInt();
|
||||
children[element->params_count + child]->render(info, viewport, true);
|
||||
if(child < children.count())
|
||||
children[element->params_count + child]
|
||||
->render(info, viewport, true);
|
||||
}
|
||||
else if(element->type == LINE_ALTERNATOR)
|
||||
{
|
||||
|
@ -1016,6 +1018,8 @@ QVariant ParseTreeNode::evalTag(const RBRenderInfo& info, bool conditional,
|
|||
|
||||
if(child < branches)
|
||||
return child;
|
||||
else if(branches == 1)
|
||||
return 2;
|
||||
else
|
||||
return branches - 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue