[aseprite] 97/250: Minor change in Timeline::showCel()
Tobias Hansen
thansen at moszumanska.debian.org
Sun Dec 20 15:27:17 UTC 2015
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit 6550093f1fd5c7a91a57f186e3c479cce1da2867
Author: David Capello <davidcapello at gmail.com>
Date: Mon Sep 28 12:09:34 2015 -0300
Minor change in Timeline::showCel()
---
src/app/ui/timeline.cpp | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/src/app/ui/timeline.cpp b/src/app/ui/timeline.cpp
index dc9c1db..e296163 100644
--- a/src/app/ui/timeline.cpp
+++ b/src/app/ui/timeline.cpp
@@ -2176,25 +2176,23 @@ void Timeline::updateStatusBar(ui::Message* msg)
void Timeline::showCel(LayerIndex layer, frame_t frame)
{
gfx::Point scroll = getViewScroll();
- int x1, y1, x2, y2;
+ gfx::Rect celBounds(
+ m_viewportArea.x + FRMSIZE*frame - scroll.x,
+ m_viewportArea.y + LAYSIZE*(lastLayer() - layer) - scroll.y,
+ FRMSIZE, LAYSIZE);
- x1 = m_viewportArea.x + FRMSIZE*frame - scroll.x;
- y1 = m_viewportArea.y + LAYSIZE*(lastLayer() - layer) - scroll.y;
- x2 = x1 + FRMSIZE - 1;
- y2 = y1 + LAYSIZE - 1;
-
- if (x1 < m_viewportArea.x) {
- scroll.x -= m_viewportArea.x - x1;
+ if (celBounds.x < m_viewportArea.x) {
+ scroll.x -= m_viewportArea.x - celBounds.x;
}
- else if (x2 > m_viewportArea.x2()-1) {
- scroll.x += (x2) - (m_viewportArea.x2()-1);
+ else if (celBounds.x2() > m_viewportArea.x2()) {
+ scroll.x += celBounds.x2() - m_viewportArea.x2();
}
- if (y1 < m_viewportArea.y) {
- scroll.y -= m_viewportArea.y - (y1);
+ if (celBounds.y < m_viewportArea.y) {
+ scroll.y -= m_viewportArea.y - celBounds.y;
}
- else if (y2 > m_viewportArea.y2()-1) {
- scroll.y += (y2) - (m_viewportArea.y2()-1);
+ else if (celBounds.y2() > m_viewportArea.y2()) {
+ scroll.y += celBounds.y2() - m_viewportArea.y2();
}
setViewScroll(scroll);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list