diff --git a/src/spiral-context.cpp b/src/spiral-context.cpp
index 4e0fd98787e109af84e7c2b74c48acf17a5c52b6..56c5b0ebd76bf89d1407b1e18b7d4a26ece8a483 100644 (file)
--- a/src/spiral-context.cpp
+++ b/src/spiral-context.cpp
#include "config.h"
#include <gdk/gdkkeysyms.h>
#include "config.h"
#include <gdk/gdkkeysyms.h>
+#include <cstring>
+#include <string>
#include "macros.h"
#include "display/sp-canvas.h"
#include "macros.h"
#include "display/sp-canvas.h"
if (sc->item) sp_spiral_finish(sc);
if (ec->shape_knot_holder) {
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;
}
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
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;
}
ec->shape_knot_holder = NULL;
}
dragging = TRUE;
sc->center = Inkscape::setup_for_drag_start(desktop, event_context, 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_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 |
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
( GDK_KEY_PRESS_MASK |
@@ -291,10 +294,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));
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_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);
sp_spiral_drag(sc, motion_dt, event->motion.state);
+
+ gobble_motion_events(GDK_BUTTON1_MASK);
+
ret = TRUE;
}
break;
ret = TRUE;
}
break;
NR::Point const p0 = sp_desktop_dt2root_xy_point(desktop, sc->center);
NR::Point p1 = sp_desktop_dt2root_xy_point(desktop, p);
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);
SPSpiral *spiral = SP_SPIRAL(sc->item);
/* status text */
GString *rads = SP_PX_TO_METRIC_STRING(rad, desktop->namedview->getDefaultMetric());
/* 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,
_("<b>Spiral</b>: radius %s, angle %5g°; with <b>Ctrl</b> to snap angle"),
rads->str, sp_round((arg + 2.0*M_PI*spiral->revo)*180/M_PI, 0.0001));
g_string_free(rads, FALSE);
_("<b>Spiral</b>: radius %s, angle %5g°; with <b>Ctrl</b> to snap angle"),
rads->str, sp_round((arg + 2.0*M_PI*spiral->revo)*180/M_PI, 0.0001));
g_string_free(rads, FALSE);