Commit 04ae4bfb authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Implement GetMetrics() for trimming sign.

parent e6d5c03f
......@@ -4042,11 +4042,24 @@ static HRESULT WINAPI dwritetrimmingsign_Draw(IDWriteInlineObject *iface, void *
return IDWriteTextLayout_Draw(This->layout, context, renderer, originX, originY);
}
static HRESULT WINAPI dwritetrimmingsign_GetMetrics(IDWriteInlineObject *iface, DWRITE_INLINE_OBJECT_METRICS *metrics)
static HRESULT WINAPI dwritetrimmingsign_GetMetrics(IDWriteInlineObject *iface, DWRITE_INLINE_OBJECT_METRICS *ret)
{
struct dwrite_trimmingsign *This = impl_from_IDWriteInlineObject(iface);
FIXME("(%p)->(%p): stub\n", This, metrics);
memset(metrics, 0, sizeof(*metrics));
DWRITE_TEXT_METRICS metrics;
HRESULT hr;
TRACE("(%p)->(%p)\n", This, ret);
hr = IDWriteTextLayout_GetMetrics(This->layout, &metrics);
if (FAILED(hr)) {
memset(ret, 0, sizeof(*ret));
return hr;
}
ret->width = metrics.width;
ret->height = 0.0;
ret->baseline = 0.0;
ret->supportsSideways = FALSE;
return S_OK;
}
......
......@@ -980,6 +980,7 @@ static const struct drawcall_entry drawellipsis_seq[] = {
static void test_CreateEllipsisTrimmingSign(void)
{
DWRITE_INLINE_OBJECT_METRICS metrics;
DWRITE_BREAK_CONDITION before, after;
IDWriteTextFormat *format;
IDWriteInlineObject *sign;
......@@ -1001,8 +1002,21 @@ static void test_CreateEllipsisTrimmingSign(void)
hr = IDWriteInlineObject_QueryInterface(sign, &IID_IDWriteTextLayout, (void**)&unk);
ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
if (0) /* crashes on native */
if (0) {/* crashes on native */
hr = IDWriteInlineObject_GetBreakConditions(sign, NULL, NULL);
hr = IDWriteInlineObject_GetMetrics(sign, NULL);
}
metrics.width = 0.0;
metrics.height = 123.0;
metrics.baseline = 123.0;
metrics.supportsSideways = TRUE;
hr = IDWriteInlineObject_GetMetrics(sign, &metrics);
ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine
ok(metrics.width > 0.0, "got %.2f\n", metrics.width);
ok(metrics.height == 0.0, "got %.2f\n", metrics.height);
ok(metrics.baseline == 0.0, "got %.2f\n", metrics.baseline);
ok(!metrics.supportsSideways, "got %d\n", metrics.supportsSideways);
before = after = DWRITE_BREAK_CONDITION_CAN_BREAK;
hr = IDWriteInlineObject_GetBreakConditions(sign, &before, &after);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment