summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2002-12-11 04:52:10 +0000
committerSilenio Quarti <silenio>2002-12-11 04:52:10 +0000
commitf53eae9a5699d294ef15abadf05c5f3aac87666c (patch)
treea3c725e9620d38dc571a8e0d4515b0616c1fdba5
parenta8f36e93e21f2177963d64964be8e74661ffe9fd (diff)
downloadeclipse.platform.swt-f53eae9a5699d294ef15abadf05c5f3aac87666c.tar.gz
eclipse.platform.swt-f53eae9a5699d294ef15abadf05c5f3aac87666c.tar.xz
eclipse.platform.swt-f53eae9a5699d294ef15abadf05c5f3aac87666c.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java
index 8be0d7160c..fa9fb8d935 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java
@@ -709,11 +709,12 @@ public void drawString (String string, int x, int y) {
public void drawString(String string, int x, int y, boolean isTransparent) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (string == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ int length = string.length();
+ if (length == 0) return;
OS.CGContextSaveGState(handle);
OS.CGContextScaleCTM(handle, 1, -1);
OS.CGContextTranslateCTM(handle, 0, -data.fontAscent);
OS.CGContextSetFillColor(handle, data.foreground);
- int length = string.length();
char[] buffer = new char[length];
string.getChars(0, length, buffer, 0);
int ptr = OS.NewPtr(length * 2);