Mercurial > projects > dwt-win
changeset 220:f54496748313
Fix foreground color in GC on non-gdip platforms
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 18 May 2008 20:52:15 +0200 |
parents | 9c2ceaa48046 |
children | 82b599d21983 |
files | dwt/graphics/GC.d |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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);