Code

Fixed redraw-area dependent result when using filters with low quality
[inkscape.git] / src / display / canvas-axonomgrid.h
index f8dc8e25a983ae81454185c14f414378d865e643..e36804d7c409d60b125fac8fc99fcc55e17c857b 100644 (file)
@@ -7,7 +7,6 @@
   */
 
 #include <display/sp-canvas.h>
-#include <libnr/nr-coord.h>
 #include "xml/repr.h"
 #include <gtkmm/box.h>
 
@@ -35,9 +34,9 @@ public:
     CanvasAxonomGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument * in_doc);
     virtual ~CanvasAxonomGrid();
 
-    void Update (NR::Matrix const &affine, unsigned int flags);
+    void Update (Geom::Matrix const &affine, unsigned int flags);
     void Render (SPCanvasBuf *buf);
-    
+
     void readRepr();
     void onReprAttrChanged (Inkscape::XML::Node * repr, const gchar *key, const gchar *oldval, const gchar *newval, bool is_interactive);
 
@@ -45,16 +44,16 @@ public:
     double angle_deg[3];  /**< Angle of each axis (note that angle[2] == 0) */
     double angle_rad[3];  /**< Angle of each axis (note that angle[2] == 0) */
     double tan_angle[3];  /**< tan(angle[.]) */
-    
+
     bool scaled;          /**< Whether the grid is in scaled mode */
-    
-    NR::Point ow;         /**< Transformed origin by the affine for the zoom */
+
+    Geom::Point ow;         /**< Transformed origin by the affine for the zoom */
     double lyw;           /**< Transformed length y by the affine for the zoom */
     double lxw_x;
     double lxw_z;
     double spacing_ylines;
-                          
-    NR::Point sw;          /**< the scaling factors of the affine transform */
+
+    Geom::Point sw;          /**< the scaling factors of the affine transform */
 
 protected:
     virtual Gtk::Widget * newSpecificWidget();
@@ -62,7 +61,7 @@ protected:
 private:
     CanvasAxonomGrid(const CanvasAxonomGrid&);
     CanvasAxonomGrid& operator=(const CanvasAxonomGrid&);
-    
+
     void updateWidgets();
 };
 
@@ -71,20 +70,25 @@ private:
 class CanvasAxonomGridSnapper : public LineSnapper
 {
 public:
-    CanvasAxonomGridSnapper(CanvasAxonomGrid *grid, SnapManager const *sm, Geom::Coord const d);
+    CanvasAxonomGridSnapper(CanvasAxonomGrid *grid, SnapManager *sm, Geom::Coord const d);
+    bool ThisSnapperMightSnap() const;
+
+    Geom::Coord getSnapperTolerance() const; //returns the tolerance of the snapper in screen pixels (i.e. independent of zoom)
+       bool getSnapperAlwaysSnap() const; //if true, then the snapper will always snap, regardless of its tolerance
 
-private:    
+private:
     LineList _getSnapLines(Geom::Point const &p) const;
-    void _addSnappedLine(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, Geom::Point const normal_to_line, const Geom::Point point_on_line) const;
+    void _addSnappedLine(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source, Geom::Point const normal_to_line, const Geom::Point point_on_line) const;
+    void _addSnappedPoint(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source) const;
 
     CanvasAxonomGrid *grid;
-}; 
+};
 
 
 }; //namespace Inkscape
 
 
 
-#endif    
+#endif