From: Tingzhong Luo luotingzhong@uniontech.com
Signed-off-by: Tingzhong Luo luotingzhong@uniontech.com --- dlls/dwrite/gdiinterop.c | 1 + dlls/dwrite/tests/font.c | 8 ++++++++ 2 files changed, 9 insertions(+)
diff --git a/dlls/dwrite/gdiinterop.c b/dlls/dwrite/gdiinterop.c index 5b542d93e32..2eafe4064d2 100644 --- a/dlls/dwrite/gdiinterop.c +++ b/dlls/dwrite/gdiinterop.c @@ -451,6 +451,7 @@ static HRESULT WINAPI rendertarget_DrawGlyphRun(IDWriteBitmapRenderTarget1 *ifac } texturetype = DWRITE_TEXTURE_CLEARTYPE_3x1; } + if (bbox_ret) *bbox_ret = bounds;
if (IntersectRect(&target_rect, &target_rect, &bounds)) { diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index 81008db6f23..5052de00329 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -1225,6 +1225,7 @@ static void test_CreateBitmapRenderTarget(void) SIZE size; ULONG ref; UINT32 ch; + RECT box; HDC hdc; int ret;
@@ -1507,6 +1508,13 @@ static void test_CreateBitmapRenderTarget(void) &run, params, RGB(255, 0, 0), NULL); ok(hr == S_OK, "Failed to draw a run, hr %#lx.\n", hr);
+ /* Got render bounds if not intersect to render target */ + SetRectEmpty(&box); + hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, -100.0f, -100.0f, DWRITE_MEASURING_MODE_GDI_NATURAL, + &run, params, RGB(255, 0, 0), &box); + ok(hr == S_OK, "Failed to draw a run, hr %#lx.\n", hr); + ok(!IsRectEmpty(&box), "got empty rect\n"); + IDWriteRenderingParams_Release(params);
/* Zero sized target returns earlier. */