From: johanengelen Date: Sun, 2 Dec 2007 23:17:00 +0000 (+0000) Subject: Snapping of axonometric grid: correctly snap to vertical gridline. angled lines not... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=283821cc54ba3320bc7bf520e2f3b1a88669988d;p=inkscape.git Snapping of axonometric grid: correctly snap to vertical gridline. angled lines not implemented yet. --- diff --git a/src/display/canvas-axonomgrid.cpp b/src/display/canvas-axonomgrid.cpp index 698211b6c..cd79e00bd 100644 --- a/src/display/canvas-axonomgrid.cpp +++ b/src/display/canvas-axonomgrid.cpp @@ -640,23 +640,20 @@ CanvasAxonomGridSnapper::_getSnapLines(NR::Point const &p) const return s; } - for (unsigned int i = 0; i < 2; ++i) { + /* This is to make sure we snap to only visible grid lines */ + double scaled_spacing = grid->spacing_ylines; // this is spacing of visible lines if screen pixels - /* This is to make sure we snap to only visible grid lines */ - double scaled_spacing = grid->sw[i]; // this is spacing of visible lines if screen pixels - - // convert screen pixels to px - // FIXME: after we switch to snapping dist in screen pixels, this will be unnecessary - if (SP_ACTIVE_DESKTOP) { - scaled_spacing /= SP_ACTIVE_DESKTOP->current_zoom(); - } + // convert screen pixels to px + // FIXME: after we switch to snapping dist in screen pixels, this will be unnecessary + if (SP_ACTIVE_DESKTOP) { + scaled_spacing /= SP_ACTIVE_DESKTOP->current_zoom(); + } - NR::Coord const rounded = round_to_nearest_multiple_plus(p[i], - scaled_spacing, - grid->origin[i]); + NR::Coord const rounded = round_to_nearest_multiple_plus(p[0], + scaled_spacing, + grid->origin[0]); - s.push_back(std::make_pair(NR::Dim2(i), rounded)); - } + s.push_back(std::make_pair(NR::Dim2(0), rounded)); return s; }