summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 98c5d6f)
raw | patch | inline | side by side (parent: 98c5d6f)
author | cilix42 <cilix42@users.sourceforge.net> | |
Wed, 18 Apr 2007 13:47:43 +0000 (13:47 +0000) | ||
committer | cilix42 <cilix42@users.sourceforge.net> | |
Wed, 18 Apr 2007 13:47:43 +0000 (13:47 +0000) |
src/verbs.cpp | patch | blob | history |
diff --git a/src/verbs.cpp b/src/verbs.cpp
index a7e39e38fda5859f40366990e49081a688a7e716..c277e8563e2606d5f5381ea9449e2eb498358d1f 100644 (file)
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
#include "seltrans.h"
#include "gradient-context.h"
#include "shape-editor.h"
+#include "draw-context.h"
/**
SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
if (!dt)
return;
+ SPEventContext *ec = dt->event_context;
SPDocument *doc = sp_desktop_document(dt);
switch (GPOINTER_TO_INT(data)) {
case SP_VERB_ZOOM_IN:
{
+ // 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);
+ break;
+ }
+ }
+
NR::Rect const d = dt->get_display_area();
dt->zoom_relative( d.midpoint()[NR::X], d.midpoint()[NR::Y], zoom_inc);
break;
}
case SP_VERB_ZOOM_OUT:
{
+ // 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);
+ break;
+ }
+ }
+
NR::Rect const d = dt->get_display_area();
dt->zoom_relative( d.midpoint()[NR::X], d.midpoint()[NR::Y], 1 / zoom_inc );
break;