summaryrefslogtreecommitdiff
path: root/utils/themeeditor/models/parsetreenode.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-07 22:25:42 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-07 22:25:42 +0000
commit13e97cd5f5330e5c7f52f243ddee5cdce61edfa6 (patch)
treeee53f022c50fc005665597b4f8146809a053016f /utils/themeeditor/models/parsetreenode.cpp
parentd4f4104a4ab04cbca75dff874e57dbe34002ded7 (diff)
downloadrockbox-13e97cd5f5330e5c7f52f243ddee5cdce61edfa6.tar.gz
rockbox-13e97cd5f5330e5c7f52f243ddee5cdce61edfa6.zip
Theme Editor: Implemented line scrolling
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27344 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/models/parsetreenode.cpp')
-rw-r--r--utils/themeeditor/models/parsetreenode.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/utils/themeeditor/models/parsetreenode.cpp b/utils/themeeditor/models/parsetreenode.cpp
index b2b5fbbdb4..e5eb9df9b3 100644
--- a/utils/themeeditor/models/parsetreenode.cpp
+++ b/utils/themeeditor/models/parsetreenode.cpp
@@ -29,6 +29,7 @@
29#include "rbprogressbar.h" 29#include "rbprogressbar.h"
30 30
31#include <iostream> 31#include <iostream>
32#include <cmath>
32 33
33int ParseTreeNode::openConditionals = 0; 34int ParseTreeNode::openConditionals = 0;
34bool ParseTreeNode::breakFlag = false; 35bool ParseTreeNode::breakFlag = false;
@@ -552,8 +553,16 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport,
552 for(int i = 0; i < children.count() ; i++) 553 for(int i = 0; i < children.count() ; i++)
553 times.append(findBranchTime(children[i], info)); 554 times.append(findBranchTime(children[i], info));
554 555
556 double totalTime = 0;
557 for(int i = 0; i < children.count(); i++)
558 totalTime += times[i];
559
555 /* Now we figure out which branch to select */ 560 /* Now we figure out which branch to select */
556 double timeLeft = info.device()->data(QString("simtime")).toDouble(); 561 double timeLeft = info.device()->data(QString("simtime")).toDouble();
562
563 /* Skipping any full cycles */
564 timeLeft -= totalTime * std::floor(timeLeft / totalTime);
565
557 int branch = 0; 566 int branch = 0;
558 while(timeLeft > 0) 567 while(timeLeft > 0)
559 { 568 {
@@ -654,6 +663,17 @@ bool ParseTreeNode::execTag(const RBRenderInfo& info, RBViewport* viewport)
654 663
655 return false; 664 return false;
656 665
666 case 's':
667 switch(element->tag->name[1])
668 {
669 case '\0':
670 /* %s */
671 viewport->scrollText(info.device()->data("simtime").toDouble());
672 return true;
673 }
674
675 return false;
676
657 case 'w': 677 case 'w':
658 switch(element->tag->name[1]) 678 switch(element->tag->name[1])
659 { 679 {