Code

Don't draw anchors in LPEToolContext
authorcilix42 <cilix42@users.sourceforge.net>
Mon, 18 Aug 2008 00:37:32 +0000 (00:37 +0000)
committercilix42 <cilix42@users.sourceforge.net>
Mon, 18 Aug 2008 00:37:32 +0000 (00:37 +0000)
src/draw-anchor.cpp
src/draw-context.cpp

index 32ee8ca78be02f305cb2618a818a06977d848837..363ea0b6ea095e6383042fb4038c12a31e480a16 100644 (file)
@@ -17,6 +17,7 @@
 #include "desktop.h"
 #include "desktop-handles.h"
 #include "event-context.h"
+#include "lpe-tool-context.h"
 #include "display/sodipodi-ctrl.h"
 #include "display/curve.h"
 
 SPDrawAnchor *
 sp_draw_anchor_new(SPDrawContext *dc, SPCurve *curve, gboolean start, NR::Point delta)
 {
+    if (SP_IS_LPETOOL_CONTEXT(dc)) {
+        // suppress all kinds of anchors in LPEToolContext
+        return NULL;
+    }
+
     SPDesktop *dt = SP_EVENT_CONTEXT_DESKTOP(dc);
 
     SPDrawAnchor *a = g_new(SPDrawAnchor, 1);
index 9717c0aa1e9d56cda8c36349faa5c44618f95525..c8ce44872ad23caa4dddd34745f6e074effaa9bc 100644 (file)
@@ -439,9 +439,11 @@ spdc_attach_selection(SPDrawContext *dc, Inkscape::Selection */*sel*/)
             if ( !c->is_closed() ) {
                 SPDrawAnchor *a;
                 a = sp_draw_anchor_new(dc, c, TRUE, *(c->first_point()));
-                dc->white_anchors = g_slist_prepend(dc->white_anchors, a);
+                if (a)
+                    dc->white_anchors = g_slist_prepend(dc->white_anchors, a);
                 a = sp_draw_anchor_new(dc, c, FALSE, *(c->last_point()));
-                dc->white_anchors = g_slist_prepend(dc->white_anchors, a);
+                if (a)
+                    dc->white_anchors = g_slist_prepend(dc->white_anchors, a);
             }
         }
         /* fixme: recalculate active anchor? */