From c23606010d05bc6d0df21ddcd6f55635b6b0de08 Mon Sep 17 00:00:00 2001 From: dvlierop2 Date: Thu, 12 Apr 2007 20:12:51 +0000 Subject: [PATCH] Always snap both bboxes and nodes. Remove all 'snap bbox/nodes' options from document properties --- src/attributes-test.h | 8 +++--- src/attributes.cpp | 4 +-- src/attributes.h | 4 +-- src/snapper.cpp | 2 +- src/sp-namedview.cpp | 7 +++--- src/ui/dialog/document-properties.cpp | 36 +++++++++++++-------------- src/ui/dialog/document-properties.h | 6 ++--- 7 files changed, 34 insertions(+), 33 deletions(-) diff --git a/src/attributes-test.h b/src/attributes-test.h index 05d0e0a51..1030f9e46 100644 --- a/src/attributes-test.h +++ b/src/attributes-test.h @@ -341,8 +341,8 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"inkscape:groupmode", true}, {"sodipodi:version", true}, {"inkscape:version", true}, - {"inkscape:object-bbox", true}, - {"inkscape:object-points", true}, +/* {"inkscape:object-bbox", true}, + {"inkscape:object-points", true},*/ {"inkscape:object-paths", true}, {"inkscape:object-nodes", true}, {"inkscape:pageopacity", true}, @@ -356,10 +356,10 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"inkscape:window-height", true}, {"inkscape:window-x", true}, {"inkscape:window-y", true}, - {"inkscape:grid-bbox", true}, +/* {"inkscape:grid-bbox", true}, {"inkscape:guide-bbox", true}, {"inkscape:grid-points", true}, - {"inkscape:guide-points", true}, + {"inkscape:guide-points", true},*/ {"inkscape:current-layer", true}, {"inkscape:connector-type", true}, {"inkscape:connection-start", true}, diff --git a/src/attributes.cpp b/src/attributes.cpp index a453b726a..e7465a037 100644 --- a/src/attributes.cpp +++ b/src/attributes.cpp @@ -92,12 +92,12 @@ static SPStyleProp const props[] = { {SP_ATTR_INKSCAPE_WINDOW_HEIGHT, "inkscape:window-height"}, {SP_ATTR_INKSCAPE_WINDOW_X, "inkscape:window-x"}, {SP_ATTR_INKSCAPE_WINDOW_Y, "inkscape:window-y"}, - {SP_ATTR_INKSCAPE_GRID_BBOX, "inkscape:grid-bbox"}, +/* {SP_ATTR_INKSCAPE_GRID_BBOX, "inkscape:grid-bbox"}, {SP_ATTR_INKSCAPE_GUIDE_BBOX, "inkscape:guide-bbox"}, {SP_ATTR_INKSCAPE_OBJECT_BBOX, "inkscape:object-bbox"}, {SP_ATTR_INKSCAPE_GRID_POINTS, "inkscape:grid-points"}, {SP_ATTR_INKSCAPE_GUIDE_POINTS, "inkscape:guide-points"}, - {SP_ATTR_INKSCAPE_OBJECT_POINTS, "inkscape:object-points"}, + {SP_ATTR_INKSCAPE_OBJECT_POINTS, "inkscape:object-points"},*/ {SP_ATTR_INKSCAPE_OBJECT_PATHS, "inkscape:object-paths"}, {SP_ATTR_INKSCAPE_OBJECT_NODES, "inkscape:object-nodes"}, {SP_ATTR_INKSCAPE_CURRENT_LAYER, "inkscape:current-layer"}, diff --git a/src/attributes.h b/src/attributes.h index 224bd379e..bff5d2aef 100644 --- a/src/attributes.h +++ b/src/attributes.h @@ -93,12 +93,12 @@ enum SPAttributeEnum { SP_ATTR_INKSCAPE_WINDOW_HEIGHT, SP_ATTR_INKSCAPE_WINDOW_X, SP_ATTR_INKSCAPE_WINDOW_Y, - SP_ATTR_INKSCAPE_GRID_BBOX, + /*SP_ATTR_INKSCAPE_GRID_BBOX, SP_ATTR_INKSCAPE_GUIDE_BBOX, SP_ATTR_INKSCAPE_OBJECT_BBOX, SP_ATTR_INKSCAPE_GRID_POINTS, SP_ATTR_INKSCAPE_GUIDE_POINTS, - SP_ATTR_INKSCAPE_OBJECT_POINTS, + SP_ATTR_INKSCAPE_OBJECT_POINTS,*/ SP_ATTR_INKSCAPE_OBJECT_PATHS, SP_ATTR_INKSCAPE_OBJECT_NODES, SP_ATTR_INKSCAPE_CURRENT_LAYER, diff --git a/src/snapper.cpp b/src/snapper.cpp index 3d5b33c16..105ec4631 100644 --- a/src/snapper.cpp +++ b/src/snapper.cpp @@ -26,7 +26,7 @@ Inkscape::Snapper::Snapper(SPNamedView const *nv, NR::Coord const d) : _named_vi g_assert(_named_view != NULL); g_assert(SP_IS_NAMEDVIEW(_named_view)); - setSnapTo(BBOX_POINT, true); + setSnapTo(BBOX_POINT | SNAP_POINT, true); //Snap any point. In v0.45 and earlier, this was controlled in the preferences tab } /** diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index 26c53c8e0..e5cfa7924 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -167,12 +167,12 @@ static void sp_namedview_build(SPObject *object, SPDocument *document, Inkscape: sp_object_read_attr(object, "inkscape:window-height"); sp_object_read_attr(object, "inkscape:window-x"); sp_object_read_attr(object, "inkscape:window-y"); - sp_object_read_attr(object, "inkscape:grid-bbox"); +/* sp_object_read_attr(object, "inkscape:grid-bbox"); sp_object_read_attr(object, "inkscape:guide-bbox"); sp_object_read_attr(object, "inkscape:object-bbox"); sp_object_read_attr(object, "inkscape:grid-points"); sp_object_read_attr(object, "inkscape:guide-points"); - sp_object_read_attr(object, "inkscape:object-points"); + sp_object_read_attr(object, "inkscape:object-points");*/ sp_object_read_attr(object, "inkscape:object-paths"); sp_object_read_attr(object, "inkscape:object-nodes"); sp_object_read_attr(object, "inkscape:current-layer"); @@ -435,7 +435,7 @@ static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *va nv->window_y = value ? atoi(value) : -1; // -1 means not set object->requestModified(SP_OBJECT_MODIFIED_FLAG); break; - case SP_ATTR_INKSCAPE_GRID_BBOX: +/* case SP_ATTR_INKSCAPE_GRID_BBOX: nv->snap_manager.grid.setSnapTo(Inkscape::Snapper::BBOX_POINT, value ? sp_str_to_bool(value) : TRUE); object->requestModified(SP_OBJECT_MODIFIED_FLAG); break; @@ -459,6 +459,7 @@ static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *va nv->snap_manager.object.setSnapTo(Inkscape::Snapper::SNAP_POINT, (value) ? sp_str_to_bool(value) : FALSE); object->requestModified(SP_OBJECT_MODIFIED_FLAG); break; +*/ case SP_ATTR_INKSCAPE_OBJECT_PATHS: nv->snap_manager.object.setSnapToPaths(value ? sp_str_to_bool(value) : TRUE); object->requestModified(SP_OBJECT_MODIFIED_FLAG); diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index fff815d8c..2041adbf2 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -300,12 +300,12 @@ DocumentProperties::build_snap() { _page_snap.show(); - _rcbsnbo.init (_("_Snap bounding boxes to objects"), +/* _rcbsnbo.init (_("_Snap bounding boxes to objects"), _("Snap the edges of the object bounding boxes to other objects"), "inkscape:object-bbox", _wr); _rcbsnnob.init (_("Snap nodes _to objects"), _("Snap the nodes of objects to other objects"), - "inkscape:object-points", _wr); + "inkscape:object-points", _wr);*/ _rcbsnop.init (_("Snap to object _paths"), _("Snap to other object paths"), "inkscape:object-paths", _wr); @@ -316,22 +316,22 @@ DocumentProperties::build_snap() _("Snapping distance, in screen pixels, for snapping to objects"), _("If set, objects snap to the nearest object, regardless of distance"), "objecttolerance", _wr); - _rcbsnbb.init (_("Snap _bounding boxes to grid"), +/* _rcbsnbb.init (_("Snap _bounding boxes to grid"), _("Snap the edges of the object bounding boxes"), "inkscape:grid-bbox", _wr); _rcbsnnod.init (_("Snap nodes to _grid"), _("Snap path nodes, text baselines, ellipse centers, etc."), - "inkscape:grid-points", _wr); + "inkscape:grid-points", _wr);*/ _rsu_sn.init (_("Snap sens_itivity:"), _("Always snap"), _("Snapping distance, in screen pixels, for snapping to grid"), _("If set, objects snap to the nearest grid line, regardless of distance"), "gridtolerance", _wr); - _rcb_snpgui.init (_("Snap bounding boxes to g_uides"), +/* _rcb_snpgui.init (_("Snap bounding boxes to g_uides"), _("Snap the edges of the object bounding boxes"), "inkscape:guide-bbox", _wr); _rcb_snbgui.init (_("Snap p_oints to guides"), _("Snap path nodes, text baselines, ellipse centers, etc."), - "inkscape:guide-points", _wr); + "inkscape:guide-points", _wr);*/ _rsu_gusn.init (_("Snap sensiti_vity:"), _("Always snap"), _("Snapping distance, in screen pixels, for snapping to guides"), _("If set, objects snap to the nearest guide, regardless of distance"), @@ -346,20 +346,20 @@ DocumentProperties::build_snap() const Gtk::Widget* array[] = { label_o, 0, - 0, _rcbsnbo._button, - 0, _rcbsnnob._button, +// 0, _rcbsnbo._button, +// 0, _rcbsnnob._button, 0, _rcbsnop._button, 0, _rcbsnon._button, 0, _rsu_sno._vbox, 0, 0, label_gr, 0, - 0, _rcbsnbb._button, - 0, _rcbsnnod._button, +// 0, _rcbsnbb._button, +// 0, _rcbsnnod._button, 0, _rsu_sn._vbox, 0, 0, label_gu, 0, - 0, _rcb_snpgui._button, - 0, _rcb_snbgui._button, +// 0, _rcb_snpgui._button, +// 0, _rcb_snbgui._button, 0, _rsu_gusn._vbox, }; @@ -489,18 +489,18 @@ DocumentProperties::update() _rcp_hgui.setRgba32 (nv->guidehicolor); //-----------------------------------------------------------snap - _rcbsnbo.setActive (nv->snap_manager.object.getSnapTo(Inkscape::Snapper::BBOX_POINT)); - _rcbsnnob.setActive (nv->snap_manager.object.getSnapTo(Inkscape::Snapper::SNAP_POINT)); + //_rcbsnbo.setActive (nv->snap_manager.object.getSnapTo(Inkscape::Snapper::BBOX_POINT)); + //_rcbsnnob.setActive (nv->snap_manager.object.getSnapTo(Inkscape::Snapper::SNAP_POINT)); _rcbsnop.setActive (nv->snap_manager.object.getSnapToPaths()); _rcbsnop.setActive (nv->snap_manager.object.getSnapToNodes()); _rsu_sno.setValue (nv->objecttolerance); - _rcbsnbb.setActive (nv->snap_manager.grid.getSnapTo(Inkscape::Snapper::BBOX_POINT)); - _rcbsnnod.setActive (nv->snap_manager.grid.getSnapTo(Inkscape::Snapper::SNAP_POINT)); + //_rcbsnbb.setActive (nv->snap_manager.grid.getSnapTo(Inkscape::Snapper::BBOX_POINT)); + //_rcbsnnod.setActive (nv->snap_manager.grid.getSnapTo(Inkscape::Snapper::SNAP_POINT)); _rsu_sn.setValue (nv->gridtolerance); - _rcb_snpgui.setActive (nv->snap_manager.guide.getSnapTo(Inkscape::Snapper::BBOX_POINT)); - _rcb_snbgui.setActive (nv->snap_manager.guide.getSnapTo(Inkscape::Snapper::SNAP_POINT)); + //_rcb_snpgui.setActive (nv->snap_manager.guide.getSnapTo(Inkscape::Snapper::BBOX_POINT)); + //_rcb_snbgui.setActive (nv->snap_manager.guide.getSnapTo(Inkscape::Snapper::SNAP_POINT)); _rsu_gusn.setValue (nv->guidetolerance); //-----------------------------------------------------------grids page diff --git a/src/ui/dialog/document-properties.h b/src/ui/dialog/document-properties.h index b9928914c..439ad5701 100644 --- a/src/ui/dialog/document-properties.h +++ b/src/ui/dialog/document-properties.h @@ -66,18 +66,18 @@ protected: RegisteredUnitMenu _rum_deflt; PageSizer _page_sizer; //--------------------------------------------------------------- - RegisteredCheckButton _rcbgrid, _rcbsnbb, _rcbsnnod; + RegisteredCheckButton _rcbgrid; //_rcbsnbb, _rcbsnnod RegisteredUnitMenu _rumg, _rums; RegisteredScalarUnit _rsu_ox, _rsu_oy, _rsu_sx, _rsu_sy; RegisteredColorPicker _rcp_gcol, _rcp_gmcol; RegisteredSuffixedInteger _rsi; //--------------------------------------------------------------- - RegisteredCheckButton _rcb_sgui, _rcb_snpgui, _rcb_snbgui; + RegisteredCheckButton _rcb_sgui; //_rcb_snpgui, _rcb_snbgui RegisteredUnitMenu _rum_gusn; ToleranceSlider _rsu_sn, _rsu_gusn; RegisteredColorPicker _rcp_gui, _rcp_hgui; //--------------------------------------------------------------- - RegisteredCheckButton _rcbsnbo, _rcbsnnob, _rcbsnop, _rcbsnon; + RegisteredCheckButton _rcbsnop, _rcbsnon; //_rcbsnbo, _rcbsnnob RegisteredUnitMenu _rumso; ToleranceSlider _rsu_sno; RegisteredRadioButtonPair _rrb_pix; -- 2.30.2