dwrite: Fix off by one error in glyph count adjustment.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7371325c04
commit
3d7fabf627
|
@ -1269,10 +1269,9 @@ static HRESULT layout_add_effective_run(struct dwrite_textlayout *layout, const
|
||||||
run->line = line;
|
run->line = line;
|
||||||
|
|
||||||
if (r->u.regular.run.glyphCount) {
|
if (r->u.regular.run.glyphCount) {
|
||||||
/* trim from the left */
|
/* Trim leading and trailing clusters. */
|
||||||
run->glyphcount = r->u.regular.run.glyphCount - r->u.regular.clustermap[start];
|
run->glyphcount = r->u.regular.run.glyphCount - r->u.regular.clustermap[start];
|
||||||
/* trim from the right */
|
if (start + length < r->u.regular.descr.stringLength)
|
||||||
if (start + length < r->u.regular.descr.stringLength - 1)
|
|
||||||
run->glyphcount -= r->u.regular.run.glyphCount - r->u.regular.clustermap[start + length];
|
run->glyphcount -= r->u.regular.run.glyphCount - r->u.regular.clustermap[start + length];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1626,7 +1626,7 @@ static void test_Draw(void)
|
||||||
flush_sequence(sequences, RENDERER_ID);
|
flush_sequence(sequences, RENDERER_ID);
|
||||||
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0);
|
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0);
|
||||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||||
ok_sequence(sequences, RENDERER_ID, draw_seq, "draw test", TRUE);
|
ok_sequence(sequences, RENDERER_ID, draw_seq, "draw test", FALSE);
|
||||||
IDWriteTextLayout_Release(layout);
|
IDWriteTextLayout_Release(layout);
|
||||||
|
|
||||||
/* with reduced width DrawGlyphRun() is called for every line */
|
/* with reduced width DrawGlyphRun() is called for every line */
|
||||||
|
@ -4987,7 +4987,7 @@ todo_wine
|
||||||
flush_sequence(sequences, RENDERER_ID);
|
flush_sequence(sequences, RENDERER_ID);
|
||||||
hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0f, 0.0f);
|
hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0f, 0.0f);
|
||||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||||
ok_sequence(sequences, RENDERER_ID, drawunderline4_seq, "draw underline test 4", TRUE);
|
ok_sequence(sequences, RENDERER_ID, drawunderline4_seq, "draw underline test 4", FALSE);
|
||||||
|
|
||||||
IDWriteTextLayout_Release(layout);
|
IDWriteTextLayout_Release(layout);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue