diff org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/graphics/GC.d @ 5:daf5407a1394

Fixed wrong replacement
author Frank Benoit <benoit@tionex.de>
date Wed, 04 Mar 2009 23:50:32 +0100
parents 6bf2837c50fe
children d46287db17ed
line wrap: on
line diff
--- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/graphics/GC.d	Wed Mar 04 23:46:02 2009 +0100
+++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/graphics/GC.d	Wed Mar 04 23:50:32 2009 +0100
@@ -2138,7 +2138,7 @@
         if (!isTransparent) {
             Gdip.RectF bounds;
             Gdip.Graphics_MeasureString(gdipGraphics, buffer, length_, data.gdipFont, pt, format, bounds);
-            Gdip.Graphics_FillRectangle(gdipGraphics, data.gdipBrush, x, y, cast(int)Math.rint(bounds.Width), cast(int)Math.rint(bounds.Height));
+            Gdip.Graphics_FillRectangle(gdipGraphics, data.gdipBrush, x, y, Math.round(bounds.Width), Math.round(bounds.Height));
         }
         int gstate = 0;
         auto brush = getFgBrush();
@@ -2330,7 +2330,7 @@
         if ((flags & SWT.DRAW_TRANSPARENT) is 0) {
             Gdip.RectF bounds;
             Gdip.Graphics_MeasureString(gdipGraphics, buffer, length_, data.gdipFont, pt, format, bounds);
-            Gdip.Graphics_FillRectangle(gdipGraphics, data.gdipBrush, x, y, cast(int)Math.rint(bounds.Width), cast(int)Math.rint(bounds.Height));
+            Gdip.Graphics_FillRectangle(gdipGraphics, data.gdipBrush, x, y, Math.round(bounds.Width), Math.round(bounds.Height));
         }
         int gstate = 0;
         auto brush = getFgBrush();
@@ -4752,7 +4752,7 @@
         Gdip.StringFormat_SetFormatFlags(format, formatFlags);
         Gdip.Graphics_MeasureString(data.gdipGraphics, buffer, length_, data.gdipFont, pt, format, bounds);
         Gdip.StringFormat_delete(format);
-        return new Point(length_ is 0 ? 0 : cast(int)Math.rint(bounds.Width), cast(int)Math.rint(bounds.Height));
+        return new Point(length_ is 0 ? 0 : Math.round(bounds.Width), Math.round(bounds.Height));
     }
     SIZE size;
     if (length_ is 0) {