diff options
author | neoraider <devnull@localhost> | 2008-04-15 23:47:03 +0200 |
---|---|---|
committer | neoraider <devnull@localhost> | 2008-04-15 23:47:03 +0200 |
commit | b90de8c582b41bbb3af5f77df69ae537e106ce59 (patch) | |
tree | 38d2eeab249df19c0090c1dc336d16ee68b483b4 | |
parent | cfd608527e167877d623bf5b9682b5c4b6130df9 (diff) | |
download | zoomedit-b90de8c582b41bbb3af5f77df69ae537e106ce59.tar zoomedit-b90de8c582b41bbb3af5f77df69ae537e106ce59.zip |
zoomedit:
* Some scrolling tweaks
-rw-r--r-- | src/Gui/RenderArea.cpp | 10 | ||||
-rw-r--r-- | src/Gui/RenderArea.h | 1 | ||||
-rw-r--r-- | src/View/TopView.cpp | 8 |
3 files changed, 8 insertions, 11 deletions
diff --git a/src/Gui/RenderArea.cpp b/src/Gui/RenderArea.cpp index 4d250f8..8062b80 100644 --- a/src/Gui/RenderArea.cpp +++ b/src/Gui/RenderArea.cpp @@ -193,15 +193,13 @@ void RenderArea::updateScrollbars(float x, float y) { get_window()->thaw_updates(); - updateScrollingWithSize(2*xVal, 2*yVal); + updateScrolling(); } void RenderArea::updateScrolling() { - updateScrollingWithSize(hScrollbar->get_adjustment()->get_upper()-hScrollbar->get_adjustment()->get_lower(), - vScrollbar->get_adjustment()->get_upper()-vScrollbar->get_adjustment()->get_lower()); -} - -void RenderArea::updateScrollingWithSize(float imageWidth, float imageHeight) { + const float imageWidth = hScrollbar->get_adjustment()->get_upper()-hScrollbar->get_adjustment()->get_lower(); + const float imageHeight = vScrollbar->get_adjustment()->get_upper()-vScrollbar->get_adjustment()->get_lower(); + if(hScrollbar) { if(imageWidth < getViewWidth()) xCenter = 0; diff --git a/src/Gui/RenderArea.h b/src/Gui/RenderArea.h index 61e5291..59498d4 100644 --- a/src/Gui/RenderArea.h +++ b/src/Gui/RenderArea.h @@ -79,7 +79,6 @@ class RenderArea : public Gtk::DrawingArea { void updateViewport(); void updateScrollbars(float x = 0.5f, float y = 0.5f); void updateScrolling(); - void updateScrollingWithSize(float imageWidth, float imageHeight); bool gdkGLBegin() { GtkWidget *widget = GTK_WIDGET(gobj()); diff --git a/src/View/TopView.cpp b/src/View/TopView.cpp index 08074c9..80f3f8e 100644 --- a/src/View/TopView.cpp +++ b/src/View/TopView.cpp @@ -187,13 +187,13 @@ void TopView::getBounds(float *minX, float *maxX, float *minY, float *maxY) { } if(minX) - *minX -= 5; + *minX -= 2.5f; if(maxX) - *maxX += 5; + *maxX += 2.5f; if(minY) - *minY -= 5; + *minY -= 2.5f; if(maxY) - *maxY += 5; + *maxY += 2.5f; } } |