if (surface)
{
- float width, height;
- int x, y;
-
- width = cairo_image_surface_get_width (surface) / scale;
- height = cairo_image_surface_get_height (surface) / scale;
- x = button_rect.x + (button_rect.width - layout->icon_size) / 2;
- y = button_rect.y + (button_rect.height - layout->icon_size) / 2;
-
- cairo_translate (cr, x, y);
- cairo_scale (cr,
- layout->icon_size / width,
- layout->icon_size / height);
- cairo_set_source_surface (cr, surface, 0, 0);
- cairo_paint (cr);
+ double x, y;
+ x = button_rect.x + (button_rect.width - layout->icon_size) / 2.0;
+ y = button_rect.y + (button_rect.height - layout->icon_size) / 2.0;
+ gtk_render_icon_surface (style, cr, surface, x, y);
cairo_surface_destroy (surface);
}
}