X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fspiral-context.cpp;h=3e431667f25ec3defcab471cd1400c8c605506c1;hb=876aa46cb01ee981a0a6dcc39af6fdace7be56bc;hp=1014665a18e42fb3bab9a1a6959b74684a9ba2b2;hpb=60d3de07a6473dd321c1d0016f49d13eb06c0884;p=inkscape.git diff --git a/src/spiral-context.cpp b/src/spiral-context.cpp index 1014665a1..3e431667f 100644 --- a/src/spiral-context.cpp +++ b/src/spiral-context.cpp @@ -17,6 +17,8 @@ #include "config.h" #include +#include +#include #include "macros.h" #include "display/sp-canvas.h" @@ -129,7 +131,7 @@ sp_spiral_context_dispose(GObject *object) if (sc->item) sp_spiral_finish(sc); if (ec->shape_knot_holder) { - sp_knot_holder_destroy(ec->shape_knot_holder); + delete ec->shape_knot_holder; ec->shape_knot_holder = NULL; } @@ -165,7 +167,7 @@ sp_spiral_context_selection_changed(Inkscape::Selection *selection, gpointer dat SPEventContext *ec = SP_EVENT_CONTEXT(sc); if (ec->shape_knot_holder) { // desktroy knotholder - sp_knot_holder_destroy(ec->shape_knot_holder); + delete ec->shape_knot_holder; ec->shape_knot_holder = NULL; } @@ -263,13 +265,15 @@ sp_spiral_context_root_handler(SPEventContext *event_context, GdkEvent *event) dragging = TRUE; sc->center = Inkscape::setup_for_drag_start(desktop, event_context, event); - SnapManager const &m = desktop->namedview->snap_manager; - sc->center = m.freeSnap(Inkscape::Snapper::SNAPPOINT_BBOX | Inkscape::Snapper::SNAPPOINT_NODE, sc->center, sc->item).getPoint(); + SnapManager &m = desktop->namedview->snap_manager; + m.setup(desktop, NULL); //null, because we don't have an item yet + m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, sc->center); sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate), ( GDK_KEY_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | + GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK ), NULL, event->button.time); ret = TRUE; @@ -291,10 +295,13 @@ sp_spiral_context_root_handler(SPEventContext *event_context, GdkEvent *event) NR::Point const motion_w(event->motion.x, event->motion.y); NR::Point motion_dt(event_context->desktop->w2d(motion_w)); - SnapManager const &m = desktop->namedview->snap_manager; - motion_dt = m.freeSnap(Inkscape::Snapper::SNAPPOINT_BBOX | Inkscape::Snapper::SNAPPOINT_NODE, motion_dt, sc->item).getPoint(); - + SnapManager &m = desktop->namedview->snap_manager; + m.setup(desktop, sc->item); + m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, motion_dt); sp_spiral_drag(sc, motion_dt, event->motion.state); + + gobble_motion_events(GDK_BUTTON1_MASK); + ret = TRUE; } break; @@ -432,8 +439,9 @@ sp_spiral_drag(SPSpiralContext *sc, NR::Point p, guint state) NR::Point const p0 = sp_desktop_dt2root_xy_point(desktop, sc->center); NR::Point p1 = sp_desktop_dt2root_xy_point(desktop, p); - SnapManager const &m = desktop->namedview->snap_manager; - p1 = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, p1, sc->item).getPoint(); + SnapManager &m = desktop->namedview->snap_manager; + m.setup(desktop, sc->item); + m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, p1); SPSpiral *spiral = SP_SPIRAL(sc->item); @@ -455,7 +463,7 @@ sp_spiral_drag(SPSpiralContext *sc, NR::Point p, guint state) /* status text */ GString *rads = SP_PX_TO_METRIC_STRING(rad, desktop->namedview->getDefaultMetric()); - sc->_message_context->setF(Inkscape::NORMAL_MESSAGE, + sc->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Spiral: radius %s, angle %5g°; with Ctrl to snap angle"), rads->str, sp_round((arg + 2.0*M_PI*spiral->revo)*180/M_PI, 0.0001)); g_string_free(rads, FALSE);