Code

Added skeleton files for other filter primitives' SP-objects. Added blur slider on...
[inkscape.git] / src / draw-context.cpp
index d33a33f7b12f2d740f293c97b7ad941dd336c3db..bb1f56044b0813eddb55a8d905093128f5623d0a 100644 (file)
@@ -39,7 +39,7 @@
 #include "selection-chemistry.h"
 #include "snap.h"
 #include "sp-path.h"
-
+#include "sp-namedview.h"
 
 static void sp_draw_context_class_init(SPDrawContextClass *klass);
 static void sp_draw_context_init(SPDrawContext *dc);
@@ -301,14 +301,14 @@ spdc_attach_selection(SPDrawContext *dc, Inkscape::Selection *sel)
         SPCurve *norm = sp_shape_get_curve(SP_SHAPE(item));
         sp_curve_transform(norm, sp_item_i2d_affine(dc->white_item));
         g_return_if_fail( norm != NULL );
-        dc->white_curves = sp_curve_split(norm);
+        dc->white_curves = g_slist_reverse(sp_curve_split(norm));
         sp_curve_unref(norm);
         /* Anchor list */
         for (GSList *l = dc->white_curves; l != NULL; l = l->next) {
             SPCurve *c;
             c = (SPCurve*)l->data;
             g_return_if_fail( c->end > 1 );
-            if ( c->bpath->code == NR_MOVETO_OPEN ) {
+            if ( SP_CURVE_BPATH(c)->code == NR_MOVETO_OPEN ) {
                 NArtBpath *s, *e;
                 SPDrawAnchor *a;
                 s = sp_curve_first_bpath(c);
@@ -372,9 +372,9 @@ void spdc_endpoint_snap_rotation(SPEventContext const *const ec, NR::Point &p, N
         p = o + bdot * best;
 
         /* Snap it along best vector */
-        SnapManager const m(SP_EVENT_CONTEXT_DESKTOP(ec)->namedview);
+        SnapManager const &m = SP_EVENT_CONTEXT_DESKTOP(ec)->namedview->snap_manager;
         p = m.constrainedSnap(Inkscape::Snapper::SNAP_POINT | Inkscape::Snapper::BBOX_POINT,
-                              p, best, NULL).getPoint();
+                              p, Inkscape::Snapper::ConstraintLine(best), NULL).getPoint();
     }
 }
 
@@ -387,7 +387,7 @@ void spdc_endpoint_snap_free(SPEventContext const * const ec, NR::Point& p, guin
     }
 
     /* FIXME: this should be doing bbox snap as well */
-    SnapManager const m(SP_EVENT_CONTEXT_DESKTOP(ec)->namedview);
+    SnapManager const &m = SP_EVENT_CONTEXT_DESKTOP(ec)->namedview->snap_manager;
     p = m.freeSnap(Inkscape::Snapper::BBOX_POINT | Inkscape::Snapper::SNAP_POINT, p, NULL).getPoint();
 }
 
@@ -557,7 +557,8 @@ spdc_flush_white(SPDrawContext *dc, SPCurve *gc)
             item->updateRepr();
         }
 
-        sp_document_done(doc);
+        sp_document_done(doc, SP_IS_PEN_CONTEXT(dc)? SP_VERB_CONTEXT_PEN : SP_VERB_CONTEXT_PENCIL, 
+                         /* TODO: annotate */ "draw-context.cpp:561");
     }
 
     sp_curve_unref(c);