diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2007-04-13 20:49:26 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2007-04-13 20:49:26 +0000 |
| commit | 0b9f1821ef6908d509c4b2a4c94fb0df35e6079a (patch) | |
| tree | de3a332e27b3f0d9cca5f3fc63924bbc74a1509b /src/display/canvas-grid.cpp | |
| parent | Add global preference for selector tool, chosing between GEOMETRIC_BBOX or VI... (diff) | |
| download | inkscape-0b9f1821ef6908d509c4b2a4c94fb0df35e6079a.tar.gz inkscape-0b9f1821ef6908d509c4b2a4c94fb0df35e6079a.zip | |
New Grids are now ready to go. bug testing can start i think.
(bzr r2878)
Diffstat (limited to 'src/display/canvas-grid.cpp')
| -rw-r--r-- | src/display/canvas-grid.cpp | 48 |
1 files changed, 1 insertions, 47 deletions
diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index 6644092df..6ca6b7f83 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -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) { |
