From: Tingzhong Luo luotingzhong@uniontech.com
Signed-off-by: Tingzhong Luo luotingzhong@uniontech.com --- dlls/dwrite/gdiinterop.c | 1 + dlls/dwrite/tests/font.c | 7 +++++++ 2 files changed, 8 insertions(+)
diff --git a/dlls/dwrite/gdiinterop.c b/dlls/dwrite/gdiinterop.c index c07f9e094ba..764ddf1a4df 100644 --- a/dlls/dwrite/gdiinterop.c +++ b/dlls/dwrite/gdiinterop.c @@ -452,6 +452,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 a5e5d296865..8199147b607 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -1541,6 +1541,13 @@ static void test_CreateBitmapRenderTarget(void) hr = IDWriteBitmapRenderTarget_SetPixelsPerDip(target, 1.0); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ /* Got render bounds if not intersect to render target */ + SetRectEmpty(&box); + hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.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"); + /* Check glyph position */ IDWriteFontFace_Release(fontface); fontface = create_rectfallback_fontface(factory);