[gtk+] dnd: Fix gtk_drag_set_icon_surface() with translucent surfaces
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] dnd: Fix gtk_drag_set_icon_surface() with translucent surfaces
- Date: Thu, 30 Sep 2010 14:27:58 +0000 (UTC)
commit f64e2df911eb547c155da488d48ec5bf89ab6b44
Author: Benjamin Otte <otte redhat com>
Date: Thu Sep 30 16:25:11 2010 +0200
dnd: Fix gtk_drag_set_icon_surface() with translucent surfaces
The code for surfaces with alpha content was apparently untested and
screwed up the signs.
gtk/gtkdnd.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index c7f470c..917521a 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -3290,6 +3290,8 @@ gtk_drag_set_icon_surface (GdkDragContext *context,
cairo_t *cr;
region = gdk_cairo_region_create_from_surface (surface);
+ cairo_region_translate (region, -extents.x, -extents.y);
+
gtk_widget_shape_combine_region (window, region);
cairo_region_destroy (region);
@@ -3302,7 +3304,7 @@ gtk_drag_set_icon_surface (GdkDragContext *context,
cr = cairo_create (saturated);
cairo_push_group_with_content (cr, CAIRO_CONTENT_COLOR_ALPHA);
- cairo_set_source_surface (cr, surface, extents.x, extents.y);
+ cairo_set_source_surface (cr, surface, -extents.x, -extents.y);
cairo_paint (cr);
cairo_set_operator (cr, CAIRO_OPERATOR_SATURATE);
cairo_paint (cr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]