zoomedit:
* Some scrolling tweaks
This commit is contained in:
parent
cfd608527e
commit
b90de8c582
3 changed files with 8 additions and 11 deletions
|
@ -193,15 +193,13 @@ void RenderArea::updateScrollbars(float x, float y) {
|
||||||
|
|
||||||
get_window()->thaw_updates();
|
get_window()->thaw_updates();
|
||||||
|
|
||||||
updateScrollingWithSize(2*xVal, 2*yVal);
|
updateScrolling();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderArea::updateScrolling() {
|
void RenderArea::updateScrolling() {
|
||||||
updateScrollingWithSize(hScrollbar->get_adjustment()->get_upper()-hScrollbar->get_adjustment()->get_lower(),
|
const float imageWidth = hScrollbar->get_adjustment()->get_upper()-hScrollbar->get_adjustment()->get_lower();
|
||||||
vScrollbar->get_adjustment()->get_upper()-vScrollbar->get_adjustment()->get_lower());
|
const float imageHeight = vScrollbar->get_adjustment()->get_upper()-vScrollbar->get_adjustment()->get_lower();
|
||||||
}
|
|
||||||
|
|
||||||
void RenderArea::updateScrollingWithSize(float imageWidth, float imageHeight) {
|
|
||||||
if(hScrollbar) {
|
if(hScrollbar) {
|
||||||
if(imageWidth < getViewWidth())
|
if(imageWidth < getViewWidth())
|
||||||
xCenter = 0;
|
xCenter = 0;
|
||||||
|
|
|
@ -79,7 +79,6 @@ class RenderArea : public Gtk::DrawingArea {
|
||||||
void updateViewport();
|
void updateViewport();
|
||||||
void updateScrollbars(float x = 0.5f, float y = 0.5f);
|
void updateScrollbars(float x = 0.5f, float y = 0.5f);
|
||||||
void updateScrolling();
|
void updateScrolling();
|
||||||
void updateScrollingWithSize(float imageWidth, float imageHeight);
|
|
||||||
|
|
||||||
bool gdkGLBegin() {
|
bool gdkGLBegin() {
|
||||||
GtkWidget *widget = GTK_WIDGET(gobj());
|
GtkWidget *widget = GTK_WIDGET(gobj());
|
||||||
|
|
|
@ -187,13 +187,13 @@ void TopView::getBounds(float *minX, float *maxX, float *minY, float *maxY) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(minX)
|
if(minX)
|
||||||
*minX -= 5;
|
*minX -= 2.5f;
|
||||||
if(maxX)
|
if(maxX)
|
||||||
*maxX += 5;
|
*maxX += 2.5f;
|
||||||
if(minY)
|
if(minY)
|
||||||
*minY -= 5;
|
*minY -= 2.5f;
|
||||||
if(maxY)
|
if(maxY)
|
||||||
*maxY += 5;
|
*maxY += 2.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue