summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
diff options
context:
space:
mode:
authorAlexander Kurtakov <akurtako@redhat.com>2012-11-14 11:44:06 +0200
committerAlexander Kurtakov <akurtako@redhat.com>2012-11-14 11:44:06 +0200
commit7d46d43cd21b835d179c72bde7bab59e61f13803 (patch)
treebde3cb0bec6bf2bc3d791cce062b69b8f96b1249 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
parentf0c3863919f76488edb06642c9a462968a147799 (diff)
downloadeclipse.platform.swt-7d46d43cd21b835d179c72bde7bab59e61f13803.tar.gz
eclipse.platform.swt-7d46d43cd21b835d179c72bde7bab59e61f13803.tar.xz
eclipse.platform.swt-7d46d43cd21b835d179c72bde7bab59e61f13803.zip
Bug 393856 - Consider using pango_layout_get_pixel_size
Binding for the function added and used where possible. This allows to not convert them after fetching via OS.PANGO_PIXELS calls.
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
index c1588fc89b..9e36892696 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
@@ -227,10 +227,10 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
byte [] buffer2 = new byte [length];
OS.memmove (buffer2, ptr, length);
OS.pango_layout_set_text (layout, buffer1, buffer1.length);
- OS.pango_layout_get_size (layout, w, h);
+ OS.pango_layout_get_pixel_size (layout, w, h);
OS.pango_layout_set_text (layout, buffer2, buffer2.length);
- int width = OS.PANGO_PIXELS (w [0]);
- int height = OS.PANGO_PIXELS (h [0]);
+ int width = w [0];
+ int height = h [0];
width = wHint == SWT.DEFAULT ? width : wHint;
height = hHint == SWT.DEFAULT ? height : hHint;
Rectangle trim = computeTrim (0, 0, width, height);