summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.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/Label.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/Label.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
index 1ce5e0c22e..5bc4d3b8d5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
@@ -140,7 +140,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
OS.pango_layout_set_width (labelLayout, -1);
}
int [] w = new int [1], h = new int [1];
- OS.pango_layout_get_size (labelLayout, w, h);
+ OS.pango_layout_get_pixel_size (labelLayout, w, h);
OS.pango_layout_set_width (labelLayout, pangoWidth);
if (frameHandle != 0) {
int [] labelWidth = new int [1], labelHeight = new int [1];
@@ -153,8 +153,8 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
} else {
size = new Point (0,0);
}
- size.x += wHint == SWT.DEFAULT ? OS.PANGO_PIXELS(w [0]) : wHint;
- size.y += hHint == SWT.DEFAULT ? OS.PANGO_PIXELS(h [0]) : hHint;
+ size.x += wHint == SWT.DEFAULT ? w [0] : wHint;
+ size.y += hHint == SWT.DEFAULT ? h [0] : hHint;
} else {
if (frameHandle != 0) {
int [] reqWidth = new int [1], reqHeight = new int [1];