Code

New Grids are now ready to go. bug testing can start i think.
[inkscape.git] / src / display / canvas-grid.cpp
index 6644092dffb3298d2f6e034b016655652999aa7f..6ca6b7f8335b732d1243d1997fb7479a94d1a884 100644 (file)
@@ -137,9 +137,6 @@ grid_canvasitem_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned i
 
 CanvasGrid::CanvasGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr)
 {
-    snapenabled = true;
-    visible = true;
-
     repr = in_repr;
     if (repr) {
         repr->addListener (&_repr_events, this);
@@ -221,11 +218,7 @@ CanvasGrid::createCanvasItem(SPDesktop * desktop)
 
     GridCanvasItem * item = INKSCAPE_GRID_CANVASITEM( sp_canvas_item_new(sp_desktop_gridgroup(desktop), INKSCAPE_TYPE_GRID_CANVASITEM, NULL) );
     item->grid = this;
-    if (desktop->gridsEnabled()) {
-        sp_canvas_item_show(SP_CANVAS_ITEM(item));
-    } else {
-        sp_canvas_item_hide(SP_CANVAS_ITEM(item));
-    }
+    sp_canvas_item_show(SP_CANVAS_ITEM(item));
 
     gtk_object_ref(GTK_OBJECT(item));    // since we're keeping a link to this item, we need to bump up the ref count
     canvasitems = g_slist_prepend(canvasitems, item);
@@ -233,45 +226,6 @@ CanvasGrid::createCanvasItem(SPDesktop * desktop)
     return item;
 }
 
-
-void
-CanvasGrid::hide()
-{
-    for (GSList *l = canvasitems; l != NULL; l = l->next) {
-        sp_canvas_item_hide ( SP_CANVAS_ITEM(l->data) );
-    }
-    visible = false;
-    disable_snapping(); // temporary hack, because at the moment visibilty and snapping are linked
-}
-
-void
-CanvasGrid::show()
-{
-    for (GSList *l = canvasitems; l != NULL; l = l->next) {
-        sp_canvas_item_show ( SP_CANVAS_ITEM(l->data) );
-    }
-    visible = true;
-    enable_snapping(); // temporary hack, because at the moment visibilty and snapping are linked
-}
-
-void
-CanvasGrid::set_visibility(bool visible)
-{
-    this->visible = visible;
-    if(visible) {
-        show();
-    } else {
-        hide();
-    }
-}
-
-void
-CanvasGrid::toggle_visibility()
-{
-    visible = !visible;
-    set_visibility(visible);
-}
-
 void
 CanvasGrid::on_repr_attr_changed (Inkscape::XML::Node * repr, const gchar *key, const gchar *oldval, const gchar *newval, bool is_interactive, void * data)
 {