summaryrefslogtreecommitdiffstats
path: root/src/dropper-context.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-08-28 22:53:56 +0000
committerKrzysztof Kosinski <tweenk.pl@gmail.com>2011-08-28 22:53:56 +0000
commitf4b79d4a8edc870f099fb9194c8493ec04012ad1 (patch)
tree2951d5171168abc288c00d09d04f5e5737e779d5 /src/dropper-context.cpp
parentTie the snapping of rectangle corners and quadrant points of ellipses to the ... (diff)
parentCompletely remove libnr (diff)
downloadinkscape-f4b79d4a8edc870f099fb9194c8493ec04012ad1.tar.gz
inkscape-f4b79d4a8edc870f099fb9194c8493ec04012ad1.zip
Completely remove libnr
(bzr r10589)
Diffstat (limited to 'src/dropper-context.cpp')
-rw-r--r--src/dropper-context.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/dropper-context.cpp b/src/dropper-context.cpp
index 9fbbcdc27..d91642bd2 100644
--- a/src/dropper-context.cpp
+++ b/src/dropper-context.cpp
@@ -225,25 +225,15 @@ static gint sp_dropper_context_root_handler(SPEventContext *event_context, GdkEv
Geom::Rect r(dc->centre, dc->centre);
r.expandBy(rw);
if (!r.hasZeroArea()) {
- NRRectL area;
- area.x0 = r[Geom::X].min();
- area.y0 = r[Geom::Y].min();
- area.x1 = r[Geom::X].max();
- area.y1 = r[Geom::Y].max();
- int w = area.x1 - area.x0;
- int h = area.y1 - area.y0;
- cairo_surface_t *s = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, w, h);
+ Geom::IntRect area = r.roundOutwards();
+ cairo_surface_t *s = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, area.width(), area.height());
sp_canvas_arena_render_surface(SP_CANVAS_ARENA(sp_desktop_drawing(desktop)), s, area);
ink_cairo_surface_average_color_premul(s, R, G, B, A);
cairo_surface_destroy(s);
}
} else {
// pick single pixel
- NRRectL area;
- area.x0 = floor(event->button.x);
- area.y0 = floor(event->button.y);
- area.x1 = area.x0 + 1;
- area.y1 = area.y0 + 1;
+ Geom::IntRect area = Geom::IntRect::from_xywh(floor(event->button.x), floor(event->button.y), 1, 1);
cairo_surface_t *s = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 1, 1);
sp_canvas_arena_render_surface(SP_CANVAS_ARENA(sp_desktop_drawing(desktop)), s, area);
ink_cairo_surface_average_color_premul(s, R, G, B, A);