diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2012-12-25 18:27:15 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@googlemail.com> | 2012-12-25 18:27:15 +0000 |
| commit | bdfa35f01e14b6f63c5f13022ce0c46289d5f1d8 (patch) | |
| tree | 47f03d5c010e49ce906a7ad66160b0b3a2b012d8 /src/widgets/ruler.cpp | |
| parent | desktop-widget: Use GtkStyleContext for GTK+ 3 widget rendering (diff) | |
| download | inkscape-bdfa35f01e14b6f63c5f13022ce0c46289d5f1d8.tar.gz inkscape-bdfa35f01e14b6f63c5f13022ce0c46289d5f1d8.zip | |
Stop using UNUSED_PIXELS hack in ruler. This was only required because of the padding used in the desktop widget
(bzr r11985)
Diffstat (limited to 'src/widgets/ruler.cpp')
| -rw-r--r-- | src/widgets/ruler.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/widgets/ruler.cpp b/src/widgets/ruler.cpp index 60bbb4b14..e26b13fa7 100644 --- a/src/widgets/ruler.cpp +++ b/src/widgets/ruler.cpp @@ -797,13 +797,6 @@ sp_ruler_draw_pos (SPRuler *ruler) } } -// FIXME: Figure out why this is different in Gtk+ 2 and Gtk+ 3 -#if GTK_CHECK_VERSION(3,0,0) -# define UNUSED_PIXELS 0 -#else -# define UNUSED_PIXELS 2 // There appear to be two pixels that are not being used at each end of the ruler -#endif - /** * sp_ruler_new: * @orientation: the ruler's orientation @@ -1032,7 +1025,7 @@ sp_ruler_draw_ticks (SPRuler *ruler) if ((upper - lower) == 0) goto out; - increment = (gdouble) (width + 2*UNUSED_PIXELS) / (upper - lower); // screen pixels per ruler unit + increment = (gdouble) width / (upper - lower); /* determine the scale * Use the maximum extents of the ruler to determine the largest @@ -1091,7 +1084,7 @@ sp_ruler_draw_ticks (SPRuler *ruler) // be e.g. 641.50000000000; rounding behaviour is not defined in such a case (see round.h) // and jitter will be apparent (upon redrawing some of the lines on the ruler might jump a // by a pixel, and jump back on the next redraw). This is suppressed by adding 1e-9 (that's only one nanopixel ;-)) - pos = gint(Inkscape::round((cur - lower) * increment + 1e-12)) - UNUSED_PIXELS; + pos = gint(Inkscape::round((cur - lower) * increment + 1e-12)); #if GTK_CHECK_VERSION(3,0,0) if (priv->orientation == GTK_ORIENTATION_HORIZONTAL) |
