diff options
| author | Moritz Eberl <moritz@semiodesk.com> | 2016-04-16 17:24:08 +0000 |
|---|---|---|
| committer | Moritz Eberl <moritz@semiodesk.com> | 2016-04-16 17:24:08 +0000 |
| commit | 69cb9b68955f341000342bcf3b90cfd4c41a1fd8 (patch) | |
| tree | b6061c25987d6300bd03189c03259d66bab7c0b6 /src/widgets/icon.cpp | |
| parent | Added Sebastian Faubels helper scripts for windows. (diff) | |
| parent | CMake build: builds with WITH_DBUS (diff) | |
| download | inkscape-69cb9b68955f341000342bcf3b90cfd4c41a1fd8.tar.gz inkscape-69cb9b68955f341000342bcf3b90cfd4c41a1fd8.zip | |
merge and fixed build
(bzr r14761.1.11)
Diffstat (limited to 'src/widgets/icon.cpp')
| -rw-r--r-- | src/widgets/icon.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp index f998cd66d..010b3a6fb 100644 --- a/src/widgets/icon.cpp +++ b/src/widgets/icon.cpp @@ -280,7 +280,13 @@ gboolean IconImpl::draw(GtkWidget *widget, cairo_t* cr) GtkAllocation allocation; GtkRequisition requisition; gtk_widget_get_allocation(widget, &allocation); + +#if GTK_CHECK_VERSION(3,0,0) + gtk_widget_get_preferred_size(widget, &requisition, NULL); +#else gtk_widget_get_requisition(widget, &requisition); +#endif + int x = floor(allocation.x + ((allocation.width - requisition.width) * 0.5)); int y = floor(allocation.y + ((allocation.height - requisition.height) * 0.5)); int width = gdk_pixbuf_get_width(image); |
