summaryrefslogtreecommitdiff
path: root/gtk/gtkimage.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2015-01-20 06:25:01 +0100
committerBenjamin Otte <otte@redhat.com>2015-01-20 06:30:20 +0100
commit22967f1612fc7005ccaad8c06eaf167cfecc843c (patch)
tree65a43e36deed04634f3791f371911ee98357090d /gtk/gtkimage.c
parentf7433557abd63c8e6d03ba31c14f004a0d62c173 (diff)
downloadgtk+-22967f1612fc7005ccaad8c06eaf167cfecc843c.tar.gz
image: Compute clip properly
Use the helper function we have for this, don't do it manually. This has the side effect of also supporting icon transforms.
Diffstat (limited to 'gtk/gtkimage.c')
-rw-r--r--gtk/gtkimage.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index a50298cad2..743cb8caae 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -1532,7 +1532,6 @@ static void
gtk_image_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
- GtkBorder extents;
GtkAllocation clip;
GTK_WIDGET_CLASS (gtk_image_parent_class)->size_allocate (widget, allocation);
@@ -1540,11 +1539,13 @@ gtk_image_size_allocate (GtkWidget *widget,
/* XXX: This is not strictly correct, we could compute the area
* actually occupied by the image, but I'm lazy...
*/
- _gtk_css_shadows_value_get_extents (_gtk_style_context_peek_property (gtk_widget_get_style_context (widget), GTK_CSS_PROPERTY_ICON_SHADOW), &extents);
- clip.x = allocation->x - extents.left;
- clip.width = allocation->width + extents.left + extents.right;
- clip.y = allocation->y - extents.top;
- clip.height = allocation->height + extents.top + extents.bottom;
+ _gtk_style_context_get_icon_extents (gtk_widget_get_style_context (widget),
+ &clip,
+ allocation->x,
+ allocation->y,
+ allocation->width,
+ allocation->height);
+
_gtk_widget_set_simple_clip (widget, &clip);
}