Mercurial > projects > dwt-win
changeset 203:8313535d74fa
Fix bug in FontMetrics, must be value type to hold values not by ref.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 14 Apr 2008 02:07:22 +0200 |
parents | 1d129e5f6aa6 |
children | 108ba7ff5a0b |
files | dwt/graphics/Font.d dwt/graphics/FontMetrics.d |
diffstat | 2 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/dwt/graphics/Font.d Sat Apr 12 17:50:15 2008 +0200 +++ b/dwt/graphics/Font.d Mon Apr 14 02:07:22 2008 +0200 @@ -203,7 +203,7 @@ */ public FontData[] getFontData() { if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); - LOGFONT* logFont = new LOGFONT();; + LOGFONT* logFont = new LOGFONT(); OS.GetObject(handle, LOGFONT.sizeof, logFont); return [ cast(FontData) FontData.win32_new(logFont, device.computePoints(logFont, handle))]; }
--- a/dwt/graphics/FontMetrics.d Sat Apr 12 17:50:15 2008 +0200 +++ b/dwt/graphics/FontMetrics.d Mon Apr 14 02:07:22 2008 +0200 @@ -38,7 +38,7 @@ * platforms and should never be accessed from application code. * </p> */ - public TEXTMETRIC* handle; + public TEXTMETRIC handle; /** * Prevents instances from being created outside the package. @@ -179,7 +179,7 @@ */ public static FontMetrics win32_new(TEXTMETRIC* handle) { FontMetrics fontMetrics = new FontMetrics(); - fontMetrics.handle = handle; + fontMetrics.handle = *handle; return fontMetrics; }