diff --git a/src/Axis.vala b/src/Axis.vala index 34aac0e..b30299d 100644 --- a/src/Axis.vala +++ b/src/Axis.vala @@ -143,5 +143,10 @@ namespace CairoChart { } } } + + public virtual void unzoom () { + zoom_min = min; + zoom_max = max; + } } } diff --git a/src/Chart.vala b/src/Chart.vala index 2e4d5c9..9a09efa 100644 --- a/src/Chart.vala +++ b/src/Chart.vala @@ -254,17 +254,7 @@ namespace CairoChart { * Zooms out the ``Chart``. */ public virtual void zoom_out () { - foreach (var s in series) { - s.zoom_show = true; - s.axis_x.zoom_min = s.axis_x.min; - s.axis_x.zoom_max = s.axis_x.max; - s.axis_y.zoom_min = s.axis_y.min; - s.axis_y.zoom_max = s.axis_y.max; - s.place.zoom_x_min = s.place.x_min; - s.place.zoom_x_max = s.place.x_max; - s.place.zoom_y_min = s.place.y_min; - s.place.zoom_y_max = s.place.y_max; - } + foreach (var s in series) s.unzoom(); zoom = Cairo.Rectangle() { x = 0, y = 0, width = 1, height = 1 }; zoom_1st_idx = 0; } diff --git a/src/Place.vala b/src/Place.vala index f810a4c..b6345dd 100644 --- a/src/Place.vala +++ b/src/Place.vala @@ -48,5 +48,12 @@ namespace CairoChart { zoom_y_min = y_min; zoom_y_max = y_max; } + + public virtual void unzoom () { + zoom_x_min = x_min; + zoom_x_max = x_max; + zoom_y_min = y_min; + zoom_y_max = y_max; + } } } diff --git a/src/Series.vala b/src/Series.vala index 674be21..57a7148 100644 --- a/src/Series.vala +++ b/src/Series.vala @@ -567,5 +567,12 @@ namespace CairoChart { public virtual Point128 get_real_point (Point p) { return Point128 (get_real_x(p.x), get_real_y(p.y)); } + + public virtual void unzoom () { + zoom_show = true; + axis_x.unzoom(); + axis_y.unzoom(); + place.unzoom(); + } } }