From 41729840e4085ac35b0ca47a512caf02b46afd0c Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Tue, 3 May 2016 11:32:33 +0200 Subject: [PATCH] dwrite: Use SetRect() instead of open coding it. Signed-off-by: Michael Stefaniuc Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/dwrite/freetype.c | 5 +---- dlls/dwrite/gdiinterop.c | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/dlls/dwrite/freetype.c b/dlls/dwrite/freetype.c index ec855791eb3..d8afa6919af 100644 --- a/dlls/dwrite/freetype.c +++ b/dlls/dwrite/freetype.c @@ -603,10 +603,7 @@ void freetype_get_glyph_bbox(struct dwrite_glyphbitmap *bitmap) LeaveCriticalSection(&freetype_cs); /* flip Y axis */ - bitmap->bbox.left = bbox.xMin; - bitmap->bbox.right = bbox.xMax; - bitmap->bbox.top = -bbox.yMax; - bitmap->bbox.bottom = -bbox.yMin; + SetRect(&bitmap->bbox, bbox.xMin, -bbox.yMax, bbox.xMax, -bbox.yMin); } static BOOL freetype_get_aliased_glyph_bitmap(struct dwrite_glyphbitmap *bitmap, FT_Glyph glyph) diff --git a/dlls/dwrite/gdiinterop.c b/dlls/dwrite/gdiinterop.c index 84b463aea66..ede1a125d75 100644 --- a/dlls/dwrite/gdiinterop.c +++ b/dlls/dwrite/gdiinterop.c @@ -339,9 +339,7 @@ static HRESULT WINAPI rendertarget_DrawGlyphRun(IDWriteBitmapRenderTarget1 *ifac if (FAILED(hr)) return hr; - target.left = target.top = 0; - target.right = This->size.cx; - target.bottom = This->size.cy; + SetRect(&target, 0, 0, This->size.cx, This->size.cy); if (rendermode == DWRITE_RENDERING_MODE_OUTLINE) { static const XFORM identity = { 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f };