Code

Applied patch 1503805
authorjoncruz <joncruz@users.sourceforge.net>
Sat, 10 Jun 2006 05:32:30 +0000 (05:32 +0000)
committerjoncruz <joncruz@users.sourceforge.net>
Sat, 10 Jun 2006 05:32:30 +0000 (05:32 +0000)
share/templates/default.svg
src/grid-snapper.cpp
src/preferences-skeleton.h

index a6a610fdbedc031b2e8cc1857068e55db6a8015c..17697c4e82e1a992e4484ea18acea7be0404f50a 100644 (file)
@@ -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"
index 419dc4b82a9889d95241a68eecdd6175b2346177..5c94b9a97d4772bb0648647125534271b5fe151f 100644 (file)
@@ -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));
index d79568bbfba2142e28e099cfe0b0a63c5aadc8cf..b133fbc01ff704ce795ed9ad5c1efe8e4268836e 100644 (file)
@@ -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"