X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fgrid-snapper.cpp;h=818f0abd9c2751af2c3e869a8920cf3ebe69051d;hb=b5907d886fa60e2613d2f0fa60273f4747625b26;hp=5c94b9a97d4772bb0648647125534271b5fe151f;hpb=3b5e9469e5220e0a86d27b387bfe0f4ce8f95818;p=inkscape.git diff --git a/src/grid-snapper.cpp b/src/grid-snapper.cpp index 5c94b9a97..818f0abd9 100644 --- a/src/grid-snapper.cpp +++ b/src/grid-snapper.cpp @@ -7,6 +7,7 @@ * Frank Felfe * Carl Hetherington * + * Copyright (C) 2006 Johan Engelen * Copyright (C) 1999-2002 Authors * * Released under GNU GPL, read the file 'COPYING' for more information @@ -16,6 +17,7 @@ #include "inkscape.h" #include "desktop.h" #include "display/canvas-grid.h" +#include "display/canvas-axonomgrid.h" /** * \return x rounded to the nearest multiple of c1 plus c0. @@ -37,7 +39,8 @@ Inkscape::GridSnapper::GridSnapper(SPNamedView const *nv, NR::Coord const d) : L } -Inkscape::LineSnapper::LineList Inkscape::GridSnapper::_getSnapLines(NR::Point const &p) const +Inkscape::LineSnapper::LineList +Inkscape::GridSnapper::_getSnapLines(NR::Point const &p) const { LineList s; @@ -45,14 +48,16 @@ Inkscape::LineSnapper::LineList Inkscape::GridSnapper::_getSnapLines(NR::Point c return s; } - SPCGrid *griditem = NULL; + CXYGrid *griditem = NULL; for (GSList *l = _named_view->gridviews; l != NULL; l = l->next) { // FIXME : this is a hack since there is only one view for now // but when we'll handle multiple views, snapping should // must be rethought and maybe only the current view // should give back it's SHOWN lines to snap to - // For now, the last SPCGrid in _named_view->gridviews will be used. - griditem = SP_CGRID(l->data); + // For now, the last CXYGrid in _named_view->gridviews will be used. + if ( INKSCAPE_IS_CXYGRID(GTK_OBJECT(l->data)) ) { + griditem = INKSCAPE_CXYGRID(l->data); + } } g_assert(griditem != NULL);