diff options
| author | Ralf Stephan <ralf@ark.in-berlin.de> | 2006-02-15 19:04:29 +0000 |
|---|---|---|
| committer | rwst <rwst@users.sourceforge.net> | 2006-02-15 19:04:29 +0000 |
| commit | 7b0114087822b9f011d740f1279d1d9ed983a88c (patch) | |
| tree | 159bd147d5a3b2daa65b327dd3f5d0b2e764eeb9 /src/zoom-context.cpp | |
| parent | fix 1432089: stroke is not drawn not only when it's not set but also when it'... (diff) | |
| download | inkscape-7b0114087822b9f011d740f1279d1d9ed983a88c.tar.gz inkscape-7b0114087822b9f011d740f1279d1d9ed983a88c.zip | |
bulk trailing spaces removal. consistency through MD5 of binary
(bzr r149)
Diffstat (limited to 'src/zoom-context.cpp')
| -rw-r--r-- | src/zoom-context.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/zoom-context.cpp b/src/zoom-context.cpp index f7bae09e9..62395581f 100644 --- a/src/zoom-context.cpp +++ b/src/zoom-context.cpp @@ -43,7 +43,7 @@ static bool escaped; GType sp_zoom_context_get_type(void) { static GType type = 0; - + if (!type) { GTypeInfo info = { sizeof(SPZoomContextClass), @@ -57,16 +57,16 @@ GType sp_zoom_context_get_type(void) }; type = g_type_register_static(SP_TYPE_EVENT_CONTEXT, "SPZoomContext", &info, (GTypeFlags) 0); } - + return type; } static void sp_zoom_context_class_init(SPZoomContextClass *klass) { SPEventContextClass *event_context_class = (SPEventContextClass *) klass; - + parent_class = (SPEventContextClass*) g_type_class_peek_parent(klass); - + event_context_class->setup = sp_zoom_context_setup; event_context_class->finish = sp_zoom_context_finish; @@ -77,7 +77,7 @@ static void sp_zoom_context_class_init(SPZoomContextClass *klass) static void sp_zoom_context_init (SPZoomContext *zoom_context) { SPEventContext *event_context = SP_EVENT_CONTEXT(zoom_context); - + event_context->cursor_shape = cursor_zoom_xpm; event_context->hot_x = 6; event_context->hot_y = 6; @@ -110,7 +110,7 @@ static gint sp_zoom_context_item_handler(SPEventContext *event_context, SPItem * if (((SPEventContextClass *) parent_class)->item_handler) { ret = ((SPEventContextClass *) parent_class)->item_handler (event_context, item, event); } - + return ret; } @@ -119,17 +119,17 @@ static gint sp_zoom_context_root_handler(SPEventContext *event_context, GdkEvent SPDesktop *desktop = event_context->desktop; tolerance = prefs_get_int_attribute_limited ("options.dragtolerance", "value", 0, 0, 100); double const zoom_inc = prefs_get_double_attribute_limited("options.zoomincrement", "value", M_SQRT2, 1.01, 10); - + gint ret = FALSE; - + switch (event->type) { case GDK_BUTTON_PRESS: if (event->button.button == 1) { // save drag origin - xp = (gint) event->button.x; + xp = (gint) event->button.x; yp = (gint) event->button.y; within_tolerance = true; - + NR::Point const button_w(event->button.x, event->button.y); NR::Point const button_dt(desktop->w2d(button_w)); Inkscape::Rubberband::get()->start(desktop, button_dt); @@ -139,27 +139,27 @@ static gint sp_zoom_context_root_handler(SPEventContext *event_context, GdkEvent ret = TRUE; } break; - + case GDK_MOTION_NOTIFY: if (event->motion.state & GDK_BUTTON1_MASK) { ret = TRUE; - + if ( within_tolerance && ( abs( (gint) event->motion.x - xp ) < tolerance ) && ( abs( (gint) event->motion.y - yp ) < tolerance ) ) { break; // do not drag if we're within tolerance from origin } - // Once the user has moved farther than tolerance from the original location - // (indicating they intend to move the object, not click), then always process the + // Once the user has moved farther than tolerance from the original location + // (indicating they intend to move the object, not click), then always process the // motion notify coordinates as given (no snapping back to origin) - within_tolerance = false; - + within_tolerance = false; + NR::Point const motion_w(event->motion.x, event->motion.y); NR::Point const motion_dt(desktop->w2d(motion_w)); Inkscape::Rubberband::get()->move(motion_dt); } break; - + case GDK_BUTTON_RELEASE: if ( event->button.button == 1 ) { NR::Maybe<NR::Rect> const b = Inkscape::Rubberband::get()->getRectangle(); @@ -176,22 +176,22 @@ static gint sp_zoom_context_root_handler(SPEventContext *event_context, GdkEvent ret = TRUE; } Inkscape::Rubberband::get()->stop(); - xp = yp = 0; + xp = yp = 0; escaped = false; break; - + case GDK_KEY_PRESS: switch (get_group0_keyval (&event->key)) { case GDK_Escape: Inkscape::Rubberband::get()->stop(); - xp = yp = 0; + xp = yp = 0; escaped = true; ret = TRUE; break; - case GDK_Up: - case GDK_Down: - case GDK_KP_Up: - case GDK_KP_Down: + case GDK_Up: + case GDK_Down: + case GDK_KP_Up: + case GDK_KP_Down: // prevent the zoom field from activation if (!MOD__CTRL_ONLY) ret = TRUE; |
