# HG changeset patch # User Frank Benoit # Date 1211136735 -7200 # Node ID f54496748313fa8d7da516bd3c1e464eae7b852a # Parent 9c2ceaa480465254b4c42d100e014bd4ba374ff4 Fix foreground color in GC on non-gdip platforms diff -r 9c2ceaa48046 -r f54496748313 dwt/graphics/GC.d --- a/dwt/graphics/GC.d Sun May 18 19:57:42 2008 +0200 +++ b/dwt/graphics/GC.d Sun May 18 20:52:15 2008 +0200 @@ -221,7 +221,7 @@ auto foreground = data.foreground; int rgb = ((foreground >> 16) & 0xFF) | (foreground & 0xFF00) | ((foreground & 0xFF) << 16); auto color = Gdip.Color_new(data.alpha << 24 | rgb); - // if (color is null) DWT.error(DWT.ERROR_NO_HANDLES); + if (color is 0) DWT.error(DWT.ERROR_NO_HANDLES); brush = cast(Gdip.Brush) Gdip.SolidBrush_new(color); if (brush is null) DWT.error(DWT.ERROR_NO_HANDLES); Gdip.Color_delete(color); @@ -409,7 +409,7 @@ /* Feature in Windows. PS_GEOMETRIC pens cannot have zero width. */ newPen = OS.ExtCreatePen (style | OS.PS_GEOMETRIC, Math.max(1, width), &logBrush, dashes !is null ? dashes.length : 0, dashes.ptr); } - OS.SelectObject(handle, &newPen); + OS.SelectObject(handle, newPen); data.state |= PEN; data.state &= ~NULL_PEN; if (data.hPen !is null) OS.DeleteObject(data.hPen); @@ -1678,7 +1678,7 @@ } } static if (OS.IsWinCE) { - int [] points = [x1, y1, x2, y2]; + int [4] points; points[0] = x1; points[1] = y1; points[2] = x2; points[3] = y2; OS.Polyline (handle, cast(POINT*)points.ptr, points.length / 2); } else { OS.MoveToEx (handle, x1, y1, null);