未验证 提交 a817ee14 编写于 作者: B Ben Konyi 提交者: GitHub

Fixed failure on Windows in paragraph.cc which was surfaced by enabling (#4434)

Fixed failure on Windows in paragraph.cc which was surfaced by enabling flutter_tester.exe build on bots.
上级 e8526e6f
......@@ -268,8 +268,8 @@ bool Paragraph::ComputeBidiRuns() {
? UBIDI_DEFAULT_RTL
: UBIDI_DEFAULT_LTR;
UErrorCode status = U_ZERO_ERROR;
ubidi_setPara(bidi.get(), text_.data(), text_.size(), paraLevel, nullptr,
&status);
ubidi_setPara(bidi.get(), reinterpret_cast<const UChar*>(text_.data()),
text_.size(), paraLevel, nullptr, &status);
if (!U_SUCCESS(status))
return false;
......@@ -939,9 +939,11 @@ Paragraph::PositionWithAffinity Paragraph::GetGlyphPositionAtCoordinate(
const std::vector<GlyphPosition>& line_glyph_position =
glyph_lines_[y_index].positions;
if (line_glyph_position.empty()) {
int line_start_index = std::accumulate(
glyph_lines_.begin(), glyph_lines_.begin() + y_index, 0,
[](const int a, const GlyphLine& b) { return a + b.total_code_units; });
int line_start_index =
std::accumulate(glyph_lines_.begin(), glyph_lines_.begin() + y_index, 0,
[](const int a, const GlyphLine& b) {
return a + static_cast<int>(b.total_code_units);
});
return PositionWithAffinity(line_start_index, DOWNSTREAM);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册