dwrite: Fix setting canWrapLineAfter cluster flag.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-01-26 15:44:47 +03:00 committed by Alexandre Julliard
parent d171185062
commit 2975ae9cbf
2 changed files with 8 additions and 3 deletions

View File

@ -603,10 +603,10 @@ static inline void init_cluster_metrics(const struct dwrite_textlayout *layout,
position = run->descr.textPosition + stop_position;
if (stop_glyph == run->glyphcount)
breakcondition = get_effective_breakpoint(layout, stop_position).breakConditionAfter;
breakcondition = get_effective_breakpoint(layout, position).breakConditionAfter;
else {
breakcondition = get_effective_breakpoint(layout, stop_position).breakConditionBefore;
if (stop_position) position = stop_position - 1;
breakcondition = get_effective_breakpoint(layout, position).breakConditionBefore;
if (stop_position) position -= 1;
}
metrics->canWrapLineAfter = breakcondition == DWRITE_BREAK_CONDITION_CAN_BREAK ||

View File

@ -1907,6 +1907,7 @@ todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(count == 2, "got %u\n", count);
ok(metrics[0].isWhitespace == 0, "got %d\n", metrics[0].isWhitespace);
ok(metrics[0].canWrapLineAfter == 0, "got %d\n", metrics[0].canWrapLineAfter);
ok(metrics[1].isWhitespace == 1, "got %d\n", metrics[1].isWhitespace);
ok(metrics[1].canWrapLineAfter == 1, "got %d\n", metrics[1].canWrapLineAfter);
IDWriteTextLayout_Release(layout);
@ -1990,6 +1991,10 @@ todo_wine {
for (i = 0; i < count; i++) {
ok(metrics[i].length == 1, "%d: got %d\n", i, metrics[i].length);
ok(metrics[i].isSoftHyphen == (i == count - 1), "%d: got %d\n", i, metrics[i].isSoftHyphen);
if (metrics[i].isNewline) {
ok(metrics[i].width == 0.0f, "%u: got width %f\n", i, metrics[i].width);
ok(metrics[i].canWrapLineAfter == 1, "%u: got %d\n", i, metrics[i].canWrapLineAfter);
}
}
IDWriteTextLayout_Release(layout);