From: joncruz Date: Sat, 10 Jun 2006 05:32:30 +0000 (+0000) Subject: Applied patch 1503805 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3b5e9469e5220e0a86d27b387bfe0f4ce8f95818;p=inkscape.git Applied patch 1503805 --- diff --git a/share/templates/default.svg b/share/templates/default.svg index a6a610fdb..17697c4e8 100644 --- a/share/templates/default.svg +++ b/share/templates/default.svg @@ -16,6 +16,9 @@ pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" + gridtolerance="10000" + guidetolerance="10" + objecttolerance="10" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.35" diff --git a/src/grid-snapper.cpp b/src/grid-snapper.cpp index 419dc4b82..5c94b9a97 100644 --- a/src/grid-snapper.cpp +++ b/src/grid-snapper.cpp @@ -13,6 +13,8 @@ */ #include "sp-namedview.h" +#include "inkscape.h" +#include "desktop.h" #include "display/canvas-grid.h" /** @@ -58,10 +60,16 @@ Inkscape::LineSnapper::LineList Inkscape::GridSnapper::_getSnapLines(NR::Point c for (unsigned int i = 0; i < 2; ++i) { /* This is to make sure we snap to only visible grid lines */ - double const scale = griditem->scaled[i] ? griditem->empspacing : 1; + double scaled_spacing = griditem->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(); + } NR::Coord const rounded = round_to_nearest_multiple_plus(p[i], - _named_view->gridspacing[i] * scale, + scaled_spacing, _named_view->gridorigin[i]); s.push_back(std::make_pair(NR::Dim2(i), rounded)); diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h index d79568bbf..b133fbc01 100644 --- a/src/preferences-skeleton.h +++ b/src/preferences-skeleton.h @@ -41,8 +41,6 @@ static char const preferences_skeleton[] = " objecttolerance=\"10.0\"\n" " gridtolerance=\"10.0\"\n" " guidetolerance=\"10.0\"\n" -" gridspacingx=\"10px\"\n" -" gridspacingy=\"10px\"\n" " inkscape:pageopacity=\"0.0\"\n" " inkscape:pageshadow=\"2\"\n" " inkscape:window-width=\"640\"\n"