diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2006-10-23 19:13:18 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2006-10-23 19:13:18 +0000 |
| commit | 15866fe5cfeeea8d217499301fe70f9edf1a12d0 (patch) | |
| tree | a132f144c8a8322528d42aadae486ae5318c9b6e /src | |
| parent | Axonometric grid: snapping to vertical gridlines (diff) | |
| download | inkscape-15866fe5cfeeea8d217499301fe70f9edf1a12d0.tar.gz inkscape-15866fe5cfeeea8d217499301fe70f9edf1a12d0.zip | |
axonomgrid: Bugfix
(bzr r1847)
Diffstat (limited to 'src')
| -rw-r--r-- | src/axonomgrid-snapper.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/axonomgrid-snapper.cpp b/src/axonomgrid-snapper.cpp index 674357d44..811eb4218 100644 --- a/src/axonomgrid-snapper.cpp +++ b/src/axonomgrid-snapper.cpp @@ -15,7 +15,7 @@ #include "sp-namedview.h"
#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.
@@ -27,10 +27,7 @@ */
/* FIXME: move this somewhere else, perhaps */
-static double round_to_nearest_multiple_plus(double x, double const c1, double const c0)
-{
- return floor((x - c0) / c1 + .5) * c1 + c0;
-}
+static
Inkscape::AxonomGridSnapper::AxonomGridSnapper(SPNamedView const *nv, NR::Coord const d) : LineSnapper(nv, d)
{
@@ -40,20 +37,25 @@ Inkscape::AxonomGridSnapper::AxonomGridSnapper(SPNamedView const *nv, NR::Coord Inkscape::LineSnapper::LineList
Inkscape::AxonomGridSnapper::_getSnapLines(NR::Point const &p) const
{
+ double round_to_nearest_multiple_plus(double x, double const c1, double const c0)
+ {
+ return floor((x - c0) / c1 + .5) * c1 + c0;
+ }
+
LineList s;
if ( NULL == _named_view ) {
return s;
}
- SPCGrid *griditem = NULL;
+ SPCAxonomGrid *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);
+ griditem = SP_CAXONOMGRID(l->data);
}
g_assert(griditem != NULL);
|
