From: buliabyak Date: Tue, 18 Dec 2007 17:57:55 +0000 (+0000) Subject: speedify zooming by keys X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=731842f27399f7dd33356407c1d516c6075a4a04;p=inkscape.git speedify zooming by keys --- diff --git a/src/verbs.cpp b/src/verbs.cpp index 770550dfd..f5ff45a0b 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1532,34 +1532,38 @@ ZoomVerb::perform(SPAction *action, void *data, void */*pdata*/) switch (GPOINTER_TO_INT(data)) { case SP_VERB_ZOOM_IN: { + gint mul = 1 + gobble_key_events( + GDK_KP_Add, 0); // with any mask // While drawing with the pen/pencil tool, zoom towards the end of the unfinished path if (tools_isactive(dt, TOOLS_FREEHAND_PENCIL) || tools_isactive(dt, TOOLS_FREEHAND_PEN)) { SPCurve *rc = SP_DRAW_CONTEXT(ec)->red_curve; if (sp_curve_last_bpath(rc)) { NR::Point const zoom_to (sp_curve_last_point(rc)); - dt->zoom_relative_keep_point(zoom_to, zoom_inc); + dt->zoom_relative_keep_point(zoom_to, mul*zoom_inc); break; } } NR::Rect const d = dt->get_display_area(); - dt->zoom_relative( d.midpoint()[NR::X], d.midpoint()[NR::Y], zoom_inc); + dt->zoom_relative( d.midpoint()[NR::X], d.midpoint()[NR::Y], mul*zoom_inc); break; } case SP_VERB_ZOOM_OUT: { + gint mul = 1 + gobble_key_events( + GDK_KP_Subtract, 0); // with any mask // While drawing with the pen/pencil tool, zoom away from the end of the unfinished path if (tools_isactive(dt, TOOLS_FREEHAND_PENCIL) || tools_isactive(dt, TOOLS_FREEHAND_PEN)) { SPCurve *rc = SP_DRAW_CONTEXT(ec)->red_curve; if (sp_curve_last_bpath(rc)) { NR::Point const zoom_to (sp_curve_last_point(rc)); - dt->zoom_relative_keep_point(zoom_to, 1 / zoom_inc); + dt->zoom_relative_keep_point(zoom_to, 1 / (mul*zoom_inc)); break; } } NR::Rect const d = dt->get_display_area(); - dt->zoom_relative( d.midpoint()[NR::X], d.midpoint()[NR::Y], 1 / zoom_inc ); + dt->zoom_relative( d.midpoint()[NR::X], d.midpoint()[NR::Y], 1 / (mul*zoom_inc) ); break; } case SP_VERB_ZOOM_1_1: