Code

PNG output for Cairo renderer
[inkscape.git] / src / spiral-context.cpp
index b05926b02a3a5e5050efd47af753881a704a7237..348cd88118bbfd440cfbcbdbd9a8fe4c276a865c 100644 (file)
@@ -31,6 +31,7 @@
 #include "desktop-style.h"
 #include "message-context.h"
 #include "pixmaps/cursor-spiral.xpm"
+#include "pixmaps/cursor-spiral.pixbuf"
 #include "spiral-context.h"
 #include "sp-metrics.h"
 #include <glibmm/i18n.h>
@@ -94,6 +95,11 @@ sp_spiral_context_init(SPSpiralContext *spiral_context)
     SPEventContext *event_context = SP_EVENT_CONTEXT(spiral_context);
 
     event_context->cursor_shape = cursor_spiral_xpm;
+    event_context->cursor_pixbuf = gdk_pixbuf_new_from_inline(
+            -1,
+            cursor_spiral_pixbuf,
+            FALSE,
+            NULL); 
     event_context->hot_x = 4;
     event_context->hot_y = 4;
     event_context->xp = 0;
@@ -263,7 +269,7 @@ 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);
+                SnapManager const &m = desktop->namedview->snap_manager;
                 sc->center = m.freeSnap(Inkscape::Snapper::SNAP_POINT, sc->center, sc->item).getPoint();
 
                 sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
@@ -406,11 +412,13 @@ sp_spiral_drag(SPSpiralContext *sc, NR::Point p, guint state)
         Inkscape::GC::release(repr);
         sc->item->transform = SP_ITEM(desktop->currentRoot())->getRelativeTransform(desktop->currentLayer());
         sc->item->updateRepr();
+
+        sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 5);
     }
 
     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);
+    SnapManager const &m = desktop->namedview->snap_manager;
     p1 = m.freeSnap(Inkscape::Snapper::SNAP_POINT, p1, sc->item).getPoint();
 
     SPSpiral *spiral = SP_SPIRAL(sc->item);
@@ -451,8 +459,11 @@ sp_spiral_finish(SPSpiralContext *sc)
         sp_shape_set_shape(SP_SHAPE(spiral));
         SP_OBJECT(spiral)->updateRepr(NULL, SP_OBJECT_WRITE_EXT);
 
+        sp_canvas_end_forced_full_redraws(desktop->canvas);
+
         sp_desktop_selection(desktop)->set(sc->item);
-        sp_document_done(sp_desktop_document(desktop));
+        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SPIRAL, 
+                         /* TODO: annotate */ "spiral-context.cpp:462");
 
         sc->item = NULL;
     }