From: Joel Holdsworth Date: Mon, 26 Aug 2013 15:34:54 +0000 (+0100) Subject: Removed copy-paste code from View::zoom X-Git-Tag: pulseview-0.2.0~303 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=e31551da587f1c67e3e67364b73a33fc40bf13c2;p=pulseview.git Removed copy-paste code from View::zoom --- diff --git a/pv/view/view.cpp b/pv/view/view.cpp index 026d2e7f..e6ce6621 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -145,16 +145,12 @@ void View::zoom(double steps) void View::zoom(double steps, int offset) { const double cursor_offset = _offset + _scale * offset; - _scale *= pow(3.0/2.0, -steps); - _scale = max(min(_scale, MaxScale), MinScale); - _offset = cursor_offset - _scale * offset; - - _ruler->update(); - _viewport->update(); - update_scroll(); + const double new_scale = max(min(_scale * pow(3.0/2.0, -steps), + MaxScale), MinScale); + const double new_offset = cursor_offset - new_scale * offset; + set_scale_offset(new_scale, new_offset); } - void View::set_scale_offset(double scale, double offset) { _scale = scale;