diff options
author | Silenio Quarti <silenio> | 2006-03-09 23:43:01 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2006-03-09 23:43:01 +0000 |
commit | baa15d4bd537b29c7879967cc6bfddad938fe3fa (patch) | |
tree | 3ff6296b1013916b1725eebf5df577e79e0a2936 /bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Canvas.java | |
parent | 272b7e6aa07980126e2a1fb1fbd02a4a8d5decd1 (diff) | |
download | eclipse.platform.swt-baa15d4bd537b29c7879967cc6bfddad938fe3fa.tar.gz eclipse.platform.swt-baa15d4bd537b29c7879967cc6bfddad938fe3fa.tar.xz eclipse.platform.swt-baa15d4bd537b29c7879967cc6bfddad938fe3fa.zip |
use gc background when control background is not set
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Canvas.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Canvas.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Canvas.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Canvas.java index 6f3f42729e..b0ad231ffd 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Canvas.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Canvas.java @@ -78,8 +78,11 @@ public void drawBackground (GC gc, int x, int y, int width, int height) { if (gc == null) error (SWT.ERROR_NULL_ARGUMENT); if (gc.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT); Control control = findBackgroundControl (); - if (control == null) control = this; - control.fillBackground (handle, gc.handle, new Rectangle (x, y, width, height)); + if (control != null) { + control.fillBackground (handle, gc.handle, new Rectangle (x, y, width, height)); + } else { + gc.fillRectangle (x, y, width, height); + } } /** |