Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2008-06-11 16:08:05 +0000
committerSilenio Quarti2008-06-11 16:08:05 +0000
commit51fa7a00664d57bb504511f5e4cec7f417541041 (patch)
treecf0ec4cf7be559185e5d9540754a0c556ee4a168
parenta30872ba1c6dfc2eaf17ec8145c44f30199a7f92 (diff)
downloadeclipse.platform.swt-51fa7a00664d57bb504511f5e4cec7f417541041.tar.gz
eclipse.platform.swt-51fa7a00664d57bb504511f5e4cec7f417541041.tar.xz
eclipse.platform.swt-51fa7a00664d57bb504511f5e4cec7f417541041.zip
*** empty log message ***
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java
index 884e173d02..357c707daf 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java
@@ -110,17 +110,17 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
NSRect oldRect = view.frame ();
int width = DEFAULT_WIDTH;
int height = DEFAULT_HEIGHT;
- if (!isImage) {
+ if (isImage && image != null) {
+ NSImage nsimage = image.handle;
+ NSSize size = nsimage.size ();
+ width = (int) size.width;
+ height = (int) size.height;
+ } else {
((NSBox) view).sizeToFit ();
NSRect newRect = view.frame ();
width = (int) newRect.width;
height = (int) newRect.height;
view.setFrame (oldRect);
- } else {
- NSImage nsimage = image.handle;
- NSSize size = nsimage.size ();
- width = (int) size.width;
- height = (int) size.height;
}
return new Point (width, height);
}

Back to the top