chiark / gitweb /
Clear the max/min zoom flags when changing the plot by means other than zooming.
authorRoss Younger <onyx-commits@impropriety.org.uk>
Sat, 22 Jun 2013 22:52:51 +0000 (10:52 +1200)
committerRoss Younger <onyx-commits@impropriety.org.uk>
Sat, 22 Jun 2013 22:52:51 +0000 (10:52 +1200)
gtkui/Canvas.cpp
gtkui/MainWindow.cpp
gtkui/MainWindow.h

index 1b76606..df5776c 100644 (file)
@@ -146,7 +146,7 @@ bool Canvas::end_dragrect(gdouble x, gdouble y) {
                Fractal::Point newcentre = (TR+BL)/(Fractal::Value)2.0;
                Fractal::Point newsize = TR-BL;
                main->update_params(newcentre, newsize);
-               main->new_centre_checked( newcentre );
+               main->new_centre_checked( newcentre, false );
                main->do_plot(false);
        }
        return true;
index 472e898..d899138 100644 (file)
@@ -187,7 +187,7 @@ void MainWindow::do_zoom(enum Zoom type, const Fractal::Point& newcentre) {
        // LP#1033910: Go ahead with a recentring zoom if at max, as we need to replot anyway
        // (but won't actually zoom).
        zoom_mechanics(type);
-       new_centre_checked(newcentre);
+       new_centre_checked(newcentre, true);
        do_plot(false);
 }
 
@@ -495,10 +495,10 @@ void MainWindow::do_more_iters()
 void MainWindow::update_params(Fractal::Point& ncentre, Fractal::Point& nsize)
 {
        size = nsize;
-       new_centre_checked(ncentre);
+       new_centre_checked(ncentre, false);
 }
 
-void MainWindow::new_centre_checked(const Fractal::Point& ncentre)
+void MainWindow::new_centre_checked(const Fractal::Point& ncentre, bool is_zoom)
 {
        centre = ncentre;
        Fractal::Point halfsize = size/2.0;
@@ -506,6 +506,10 @@ void MainWindow::new_centre_checked(const Fractal::Point& ncentre)
                                   BL = centre - halfsize;
        bool clipped = false;
 
+       if (!is_zoom)
+               at_min_zoom = at_max_zoom = false;
+       // if is_zoom, those mechanics check and update the min/max flags.
+
        if (real(TR) > fractal->xmax) {
                Fractal::Point shift(fractal->xmax-real(TR), 0);
                centre += shift; TR += shift; BL += shift;
index 68d69b7..128923f 100644 (file)
@@ -113,7 +113,7 @@ public:
        bool is_aspect_fixed() const { return aspectfix; }
 
        void update_params(Fractal::Point& centre, Fractal::Point& size);
-       void new_centre_checked(const Fractal::Point& centre);
+       void new_centre_checked(const Fractal::Point& centre, bool is_zoom);
 
     void do_zoom(enum Zoom z);
     void do_zoom(enum Zoom z, const Fractal::Point& newcentre);