diff options
author | Silenio Quarti <silenio> | 2002-12-11 04:52:10 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2002-12-11 04:52:10 +0000 |
commit | f53eae9a5699d294ef15abadf05c5f3aac87666c (patch) | |
tree | a3c725e9620d38dc571a8e0d4515b0616c1fdba5 | |
parent | a8f36e93e21f2177963d64964be8e74661ffe9fd (diff) | |
download | eclipse.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.java | 3 |
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); |