Code

Only in the selector tool we should snap in bbox mode (PointType = SNAPPOINT_BBOX)
authordvlierop2 <dvlierop2@users.sourceforge.net>
Tue, 7 Aug 2007 20:05:00 +0000 (20:05 +0000)
committerdvlierop2 <dvlierop2@users.sourceforge.net>
Tue, 7 Aug 2007 20:05:00 +0000 (20:05 +0000)
12 files changed:
src/arc-context.cpp
src/box3d-context.cpp
src/connector-context.cpp
src/draw-context.cpp
src/gradient-context.cpp
src/gradient-drag.cpp
src/object-edit.cpp
src/pencil-context.cpp
src/rect-context.cpp
src/spiral-context.cpp
src/star-context.cpp
src/ui/dialog/document-properties.cpp

index ef77ce78fa322f87b3718d275b16e7ef6b52c393..44c85bf0bcfe94c0455f225be5e37b1b8e62e59a 100644 (file)
@@ -264,7 +264,7 @@ static gint sp_arc_context_root_handler(SPEventContext *event_context, GdkEvent
                 ac->center = Inkscape::setup_for_drag_start(desktop, event_context, event);
 
                 SnapManager const &m = desktop->namedview->snap_manager;                
-                ac->center = m.freeSnap(Inkscape::Snapper::SNAPPOINT_BBOX | Inkscape::Snapper::SNAPPOINT_NODE, ac->center, ac->item).getPoint();
+                ac->center = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, ac->center, ac->item).getPoint();
                 
                 sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
                                     GDK_KEY_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
@@ -290,7 +290,7 @@ static gint sp_arc_context_root_handler(SPEventContext *event_context, GdkEvent
                 NR::Point motion_dt(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, ac->item).getPoint();
+                motion_dt = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, motion_dt, ac->item).getPoint();
             
                 
                 sp_arc_drag(ac, motion_dt, event->motion.state);
index de1a4e2bf5e2f884922674c4e4b4bee5a60740c0..0ef2277ea0a638e50c8729aa588112dfc69ba405 100644 (file)
@@ -327,7 +327,7 @@ static gint sp_3dbox_context_root_handler(SPEventContext *event_context, GdkEven
 
             /* Snap center */
             SnapManager const &m = desktop->namedview->snap_manager;
-            bc->center = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE | Inkscape::Snapper::SNAPPOINT_BBOX,
+            bc->center = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE,
                                     button_dt, bc->item).getPoint();
 
             sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
@@ -358,7 +358,7 @@ static gint sp_3dbox_context_root_handler(SPEventContext *event_context, GdkEven
             NR::Point motion_dt(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, bc->item).getPoint();
+            motion_dt = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, motion_dt, bc->item).getPoint();
 
             bc->ctrl_dragged  = event->motion.state & GDK_CONTROL_MASK;
 
@@ -379,7 +379,7 @@ static gint sp_3dbox_context_root_handler(SPEventContext *event_context, GdkEven
                 } else {
                     bc->drag_ptC = motion_dt;
                 }
-                bc->drag_ptC = m.freeSnap(Inkscape::Snapper::SNAPPOINT_BBOX | Inkscape::Snapper::SNAPPOINT_NODE, bc->drag_ptC, bc->item).getPoint();
+                bc->drag_ptC = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, bc->drag_ptC, bc->item).getPoint();
                 if (bc->ctrl_dragged) {
                        Box3D::PerspectiveLine pl1 (NR::Point (event_context->xp, event_context->yp), Box3D::Y, Box3D::Perspective3D::current_perspective);
                        Box3D::PerspectiveLine pl2 (bc->drag_ptB, Box3D::X, Box3D::Perspective3D::current_perspective);
index 7e8058eee5c986744049567d97b91360ffabe2ea..a072afeda2b0f64a4b45815fa9590ed430ceea64 100644 (file)
@@ -529,7 +529,7 @@ connector_handle_button_press(SPConnectorContext *const cc, GdkEventButton const
                         // This is the first point, so just snap it to the grid
                         // as there's no other points to go off.
                         SnapManager const &m = cc->desktop->namedview->snap_manager;
-                        p = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE | Inkscape::Snapper::SNAPPOINT_BBOX,
+                        p = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE,
                                        p, NULL).getPoint();
                     }
                     spcc_connector_set_initial_point(cc, p);
index 6742ddaf3325d3153297bbe4a6b88ac900fd798b..43e028aa5655032071f821e2c089a40e58b623e8 100644 (file)
@@ -354,7 +354,7 @@ void spdc_endpoint_snap_rotation(SPEventContext const *const ec, NR::Point &p, N
 
         /* Snap it along best vector */
         SnapManager const &m = SP_EVENT_CONTEXT_DESKTOP(ec)->namedview->snap_manager;
-        p = m.constrainedSnap(Inkscape::Snapper::SNAPPOINT_NODE | Inkscape::Snapper::SNAPPOINT_BBOX,
+        p = m.constrainedSnap(Inkscape::Snapper::SNAPPOINT_NODE,
                               p, Inkscape::Snapper::ConstraintLine(best), NULL).getPoint();
     }
 }
@@ -367,9 +367,8 @@ void spdc_endpoint_snap_free(SPEventContext const * const ec, NR::Point& p, guin
         return;
     }
 
-    /* FIXME: this should be doing bbox snap as well */
     SnapManager const &m = SP_EVENT_CONTEXT_DESKTOP(ec)->namedview->snap_manager;
-    p = m.freeSnap(Inkscape::Snapper::SNAPPOINT_BBOX | Inkscape::Snapper::SNAPPOINT_NODE, p, NULL).getPoint();
+    p = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, p, NULL).getPoint();
 }
 
 static SPCurve *
index 758759d6a29880d8107949a1a139ee6e228a3de5..f83625abea6b7531bdc1226de58373194bc4121c 100644 (file)
@@ -413,7 +413,7 @@ sp_gradient_context_root_handler(SPEventContext *event_context, GdkEvent *event)
             /* Snap center to nearest magnetic point */
             
             SnapManager const &m = desktop->namedview->snap_manager;
-            rc->origin = m.freeSnap(Inkscape::Snapper::SNAPPOINT_BBOX | Inkscape::Snapper::SNAPPOINT_NODE, button_dt, NULL).getPoint();
+            rc->origin = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, button_dt, NULL).getPoint();
 
             ret = TRUE;
         }
index f4070079b42c07af1a38315b349ee1735afd6c0c..171881a780208f62c7bda1375af0fcc3783f3303 100644 (file)
@@ -436,7 +436,7 @@ gr_knot_moved_handler(SPKnot *knot, NR::Point const *ppointer, guint state, gpoi
     if (!((state & GDK_SHIFT_MASK) || ((state & GDK_CONTROL_MASK) && (state & GDK_MOD1_MASK)))) {
         // Try snapping to the grid or guides
         SnapManager const &m = dragger->parent->desktop->namedview->snap_manager;
-        Inkscape::SnappedPoint s = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE | Inkscape::Snapper::SNAPPOINT_BBOX, p, NULL);
+        Inkscape::SnappedPoint s = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, p, NULL);
         if (s.getDistance() < 1e6) {
             p = s.getPoint();
             sp_knot_moveto (knot, &p);
index a0a8d42185ca3989bf5053c27a1a7c9d87a33de1..bd3bd19027d794b8e087f97e5af3766d9bf05fcd 100644 (file)
@@ -224,7 +224,7 @@ static NR::Point snap_knot_position(SPItem *item, NR::Point const &p)
     NR::Matrix const i2d (sp_item_i2d_affine (item));
     NR::Point s = p * i2d;    
     SnapManager const &m = desktop->namedview->snap_manager;
-    s = m.freeSnap(Inkscape::Snapper::SNAPPOINT_BBOX | Inkscape::Snapper::SNAPPOINT_NODE, s, item).getPoint();
+    s = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, s, item).getPoint();
     return s * i2d.inverse();
 }
 
index c32a6107a2af21891030fde6a1cd34bca5ace281..cdadd0c713d53d04c3d31386125dd8e651ca0601 100644 (file)
@@ -236,7 +236,7 @@ pencil_handle_button_press(SPPencilContext *const pc, GdkEventButton const &beve
                         selection->clear();
                         desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Creating new path"));
                         SnapManager const &m = desktop->namedview->snap_manager;
-                        p = m.freeSnap(Inkscape::Snapper::SNAPPOINT_BBOX | Inkscape::Snapper::SNAPPOINT_NODE, p, NULL).getPoint();
+                        p = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, p, NULL).getPoint();
                     } else if (selection->singleItem() && SP_IS_PATH(selection->singleItem())) {
                         desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Appending to selected path"));
                     }
@@ -306,7 +306,7 @@ pencil_handle_motion_notify(SPPencilContext *const pc, GdkEventMotion const &mev
                     p = anchor->dp;
                 } else if ((mevent.state & GDK_SHIFT_MASK) == 0) {
                     SnapManager const &m = dt->namedview->snap_manager;
-                    p = m.freeSnap(Inkscape::Snapper::SNAPPOINT_BBOX | Inkscape::Snapper::SNAPPOINT_NODE, p, NULL).getPoint();
+                    p = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, p, NULL).getPoint();
                 }
                 if ( pc->npoints != 0 ) { // buttonpress may have happened before we entered draw context!
                     spdc_add_freehand_point(pc, p, mevent.state);
index 7de7aa5072505bc6aa520e964b8b0512a704b875..71683ec8ead8105d530b642797925c8c9f95f0e8 100644 (file)
@@ -299,7 +299,7 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent
 
             /* Snap center */
             SnapManager const &m = desktop->namedview->snap_manager;
-            rc->center = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE | Inkscape::Snapper::SNAPPOINT_BBOX,
+            rc->center = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE,
                                     button_dt, rc->item).getPoint();
 
             sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
@@ -330,7 +330,7 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent
             NR::Point motion_dt(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, rc->item).getPoint();
+            motion_dt = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, motion_dt, rc->item).getPoint();
             
             sp_rect_drag(*rc, motion_dt, event->motion.state);
             
index 1014665a18e42fb3bab9a1a6959b74684a9ba2b2..4e0fd98787e109af84e7c2b74c48acf17a5c52b6 100644 (file)
@@ -264,7 +264,7 @@ sp_spiral_context_root_handler(SPEventContext *event_context, GdkEvent *event)
                 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();
+                sc->center = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, sc->center, sc->item).getPoint();
 
                 sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
                                     ( GDK_KEY_PRESS_MASK |
@@ -292,7 +292,7 @@ sp_spiral_context_root_handler(SPEventContext *event_context, GdkEvent *event)
                 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();
+                motion_dt = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, motion_dt, sc->item).getPoint();
             
                 sp_spiral_drag(sc, motion_dt, event->motion.state);
                 ret = TRUE;
index b9eed3b0e40a007bb693b2fcf3aba0fe9c57322b..385d16d0cbcf8df34e5c6dd04337f88afe86e20a 100644 (file)
@@ -276,7 +276,7 @@ static gint sp_star_context_root_handler(SPEventContext *event_context, GdkEvent
             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();
+            sc->center = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, sc->center, sc->item).getPoint();
 
             sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
                                 GDK_KEY_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
@@ -302,7 +302,7 @@ static gint sp_star_context_root_handler(SPEventContext *event_context, GdkEvent
             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();
+            motion_dt = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, motion_dt, sc->item).getPoint();
             
             sp_star_drag (sc, motion_dt, event->motion.state);
             ret = TRUE;
index 062f838f993785337c09fe12e851714cb0f7e243..e9dad3710d27859f43d1798ca9f5a6f788d0d38e 100644 (file)
@@ -267,7 +267,7 @@ DocumentProperties::build_snap()
     _page_snap.show();
        //General options
        _rcbsnbb.init (_("Snap bounding _box corners"),
-                _("Snap bounding box corners to grid lines, to guides, and to other bounding boxes"),
+                _("Snap bounding box corners to grid lines, to guides, and to other bounding boxes (only applicable to the selector tool)"),
                 "inkscape:snap-bbox", _wr);
     _rcbsnn.init (_("Snap _nodes"),
                 _("Snap nodes to grid lines, to guides, to paths, and to other nodes"),