Commit 2975ae9c authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Fix setting canWrapLineAfter cluster flag.

parent d1711850
...@@ -603,10 +603,10 @@ static inline void init_cluster_metrics(const struct dwrite_textlayout *layout, ...@@ -603,10 +603,10 @@ static inline void init_cluster_metrics(const struct dwrite_textlayout *layout,
position = run->descr.textPosition + stop_position; position = run->descr.textPosition + stop_position;
if (stop_glyph == run->glyphcount) if (stop_glyph == run->glyphcount)
breakcondition = get_effective_breakpoint(layout, stop_position).breakConditionAfter; breakcondition = get_effective_breakpoint(layout, position).breakConditionAfter;
else { else {
breakcondition = get_effective_breakpoint(layout, stop_position).breakConditionBefore; breakcondition = get_effective_breakpoint(layout, position).breakConditionBefore;
if (stop_position) position = stop_position - 1; if (stop_position) position -= 1;
} }
metrics->canWrapLineAfter = breakcondition == DWRITE_BREAK_CONDITION_CAN_BREAK || metrics->canWrapLineAfter = breakcondition == DWRITE_BREAK_CONDITION_CAN_BREAK ||
......
...@@ -1907,6 +1907,7 @@ todo_wine ...@@ -1907,6 +1907,7 @@ todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
ok(count == 2, "got %u\n", count); ok(count == 2, "got %u\n", count);
ok(metrics[0].isWhitespace == 0, "got %d\n", metrics[0].isWhitespace); 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].isWhitespace == 1, "got %d\n", metrics[1].isWhitespace);
ok(metrics[1].canWrapLineAfter == 1, "got %d\n", metrics[1].canWrapLineAfter); ok(metrics[1].canWrapLineAfter == 1, "got %d\n", metrics[1].canWrapLineAfter);
IDWriteTextLayout_Release(layout); IDWriteTextLayout_Release(layout);
...@@ -1990,6 +1991,10 @@ todo_wine { ...@@ -1990,6 +1991,10 @@ todo_wine {
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
ok(metrics[i].length == 1, "%d: got %d\n", i, metrics[i].length); 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); 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); IDWriteTextLayout_Release(layout);
......
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