Commit Graph

12 Commits

Author SHA1 Message Date
Michael Natterer d3966c2c90 app: add more accessors to GimpGrid and use them instead of grid->foo 2014-05-21 21:44:28 +02:00
Michael Natterer 5e2ded5020 app: add gimp_grid_get_spacing() and gimp_grid_get_offset()
and do the rounding to integer there instead of in several places.
2014-05-21 21:25:41 +02:00
Michael Natterer 08c6aefa23 Bug 588512 - Grid Spacing errors depending on unit
Always round grid spacings and offsets to integer precision when
using them for snapping and grid drawing. While we might *want* to
have subpixel precision grids, all the UI is pretending it to be
on pixel boundaries. Make that pretense an fact.
2014-05-21 20:43:05 +02:00
Michael Natterer 0add37a6cc app: remove GimpDisplayShell parameters from all GimpCanvasItem vfuncs
and get the shell from gimp_canvas_item_get_shell() if needed.  Remove
some cairo_translate() that didn't have any effect and were leftovers
from a very early canvas item code.
2013-04-18 16:46:01 +02:00
Michael Natterer 52b92e740f app: rename gimpdisplayshell-style to gimpcanvas-style
because it doesn't and shouldn't depend on GimpDisplayShell at all.
In the future, it will take its defaults from the canvas' theme.
2013-04-18 16:46:01 +02:00
Michael Natterer 64c929a1d1 app: add an own GimpCanvasItem API for transforming coords
and use it in all subclasses. Removes all gimpdisplayshell-transform
dependency from all item implementations.
2013-04-18 16:46:00 +02:00
Michael Natterer 0c236cbc48 app: don't draw the grid if it covers the image entirely
Regardless of the elaborate discussion in bug #599267, as soon as the
grid starts covering the image completely (when the is no more spacing
between grid lines), it is entirely useless, so skip drawing it.
2012-03-04 20:19:57 +01:00
Michael Natterer fde934ac58 app: s/GdkRectangle/cairo_rectangle_int_t/ in all GimpCanvasItems 2011-04-10 18:15:16 +02:00
Michael Natterer 60d24b4c04 app: get rid of #ifdef USE_CAIRO_REGION almost everywhere
get replaced by GDK region functions and use the cairo region
functions unconditionally all over the place.
2010-10-22 19:58:11 +02:00
Michael Natterer 479082075b app: use cairo_region_t for canvas items if cairo >= 1.10 is available
This is a gross hack that typedefs around between GdkRegion and
cairo_region_t and has some evil #ifdefs. This is going to die
immeditately once we can depend on cairo 1.10.
2010-10-18 20:01:05 +02:00
Michael Natterer dbce9d49d9 app: fix scrolling in of dashed lines
Before, the pattern offset was always relative to the widget, which
completely destroyed the stipples when the got scrolled in. Now we
simply set the shell's scroll offsets as cairo translation and
everything looks perfect.
2010-10-03 00:52:46 +02:00
Michael Natterer 502d7c815b app: add a canvas grid item class and use it to draw the grid
Remove gimp_display_shell_draw_grid().
2010-10-02 20:57:40 +02:00