summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-08 05:30:00 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-08 05:30:00 +0000
commiteb93e3b3d26ce31407a302f49c70770ad3f98274 (patch)
treef4e6e8fc5f64676832f4b256b0790de4f6514800 /utils
parent13e97cd5f5330e5c7f52f243ddee5cdce61edfa6 (diff)
Theme Editor: Removed papause from line scrolling
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27345 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils')
-rw-r--r--utils/themeeditor/graphics/rbviewport.cpp48
-rw-r--r--utils/themeeditor/graphics/rbviewport.h1
2 files changed, 15 insertions, 34 deletions
diff --git a/utils/themeeditor/graphics/rbviewport.cpp b/utils/themeeditor/graphics/rbviewport.cpp
index 3a239c7f35..4422f19b86 100644
--- a/utils/themeeditor/graphics/rbviewport.cpp
+++ b/utils/themeeditor/graphics/rbviewport.cpp
@@ -30,8 +30,6 @@
#include "tag_table.h"
#include "skin_parser.h"
-/* Pause at beginning/end of scroll */
-const double RBViewport::scrollPause = 0.5;
/* Pixels/second of text scrolling */
const double RBViewport::scrollRate = 30;
@@ -302,23 +300,18 @@ void RBViewport::alignLeft()
if(difference > 0)
{
/* Subtracting out complete cycles */
- double totalTime = 2 * scrollPause + difference / scrollRate;
+ double totalTime = 2 * difference / scrollRate;
scrollTime -= totalTime * std::floor(scrollTime / totalTime);
/* Calculating the offset */
- if(scrollTime < scrollPause)
+ if(scrollTime < static_cast<double>(difference) / scrollRate)
{
- return;
- }
- else if(scrollTime < scrollPause + difference / scrollRate)
- {
- scrollTime -= scrollPause;
- int offset = scrollRate * scrollTime;
- leftGraphic->setOffset(offset);
+ leftGraphic->setOffset(scrollRate * scrollTime);
}
else
{
- leftGraphic->setOffset(difference);
+ scrollTime -= static_cast<double>(difference) / scrollRate;
+ leftGraphic->setOffset(difference - scrollRate * scrollTime);
}
}
}
@@ -352,23 +345,18 @@ void RBViewport::alignCenter()
if(difference > 0)
{
/* Subtracting out complete cycles */
- double totalTime = 2 * scrollPause + difference / scrollRate;
+ double totalTime = 2 * difference / scrollRate;
scrollTime -= totalTime * std::floor(scrollTime / totalTime);
/* Calculating the offset */
- if(scrollTime < scrollPause)
- {
- return;
- }
- else if(scrollTime < scrollPause + difference / scrollRate)
+ if(scrollTime < static_cast<double>(difference) / scrollRate)
{
- scrollTime -= scrollPause;
- int offset = scrollRate * scrollTime;
- centerGraphic->setOffset(offset);
+ centerGraphic->setOffset(scrollRate * scrollTime);
}
else
{
- centerGraphic->setOffset(difference);
+ scrollTime -= static_cast<double>(difference) / scrollRate;
+ centerGraphic->setOffset(difference - scrollRate * scrollTime);
}
}
@@ -397,25 +385,19 @@ void RBViewport::alignRight()
if(difference > 0)
{
/* Subtracting out complete cycles */
- double totalTime = 2 * scrollPause + difference / scrollRate;
+ double totalTime = 2 * difference / scrollRate;
scrollTime -= totalTime * std::floor(scrollTime / totalTime);
/* Calculating the offset */
- if(scrollTime < scrollPause)
+ if(scrollTime < static_cast<double>(difference) / scrollRate)
{
- return;
- }
- else if(scrollTime < scrollPause + difference / scrollRate)
- {
- scrollTime -= scrollPause;
- int offset = scrollRate * scrollTime;
- rightGraphic->setOffset(offset);
+ rightGraphic->setOffset(scrollRate * scrollTime);
}
else
{
- rightGraphic->setOffset(difference);
+ scrollTime -= static_cast<double>(difference) / scrollRate;
+ rightGraphic->setOffset(difference - scrollRate * scrollTime);
}
}
-
}
diff --git a/utils/themeeditor/graphics/rbviewport.h b/utils/themeeditor/graphics/rbviewport.h
index eeeb7191ef..a9b706d95f 100644
--- a/utils/themeeditor/graphics/rbviewport.h
+++ b/utils/themeeditor/graphics/rbviewport.h
@@ -41,7 +41,6 @@ public:
};
static const double scrollRate;
- static const double scrollPause;
RBViewport(skin_element* node, const RBRenderInfo& info);
virtual ~RBViewport();