New issue
Advanced search Search tips

Issue 866720 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 3
Type: Bug



Sign in to add a comment

gfx::RenderText::SetMaxLines not effective when using WRAP_LONG_WORDS

Project Member Reported by wychen@chromium.org, Jul 23

Issue description

auto render_text = gfx::RenderText::CreateHarfBuzzInstance();
...
render_text->SetMultiline(true);
render_text->SetMaxLines(2);
render_text->SetWordWrapBehavior(gfx::WRAP_LONG_WORDS);
render_text->Draw(...);


What is the expected result?
At most 2 lines are rendered.

What happens instead?
Sometimes more than 2 lines are rendered

This issue is not platform dependent. iOS is immune because RenderText is not used there.

 
I wonder if there is a proper OWNER for fixing RenderText issues like this.
Blocking: 853281
Project Member

Comment 3 by bugdroid1@chromium.org, Jul 25

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ffd5fe1e1570a60aa8d350f7343fca1f69614c81

commit ffd5fe1e1570a60aa8d350f7343fca1f69614c81
Author: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Date: Wed Jul 25 08:04:40 2018

Consider word wrapping behavior when rendering multiline texts

Bug: 866720
Change-Id: Ie3de731b94e6db978acbb0ef2d951b4399c2e25b
Reviewed-on: https://chromium-review.googlesource.com/1147670
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577821}
[modify] https://crrev.com/ffd5fe1e1570a60aa8d350f7343fca1f69614c81/ui/gfx/render_text.cc
[modify] https://crrev.com/ffd5fe1e1570a60aa8d350f7343fca1f69614c81/ui/gfx/render_text_harfbuzz.cc
[modify] https://crrev.com/ffd5fe1e1570a60aa8d350f7343fca1f69614c81/ui/gfx/render_text_unittest.cc

Project Member

Comment 4 by bugdroid1@chromium.org, Jul 25

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b58163857fb749cbcd721ef7048cea0812796414

commit b58163857fb749cbcd721ef7048cea0812796414
Author: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Date: Wed Jul 25 20:52:02 2018

DCHECK RenderText never renders more than max_lines()

Assert that if the text is homogeneous in style, font size,
weight, etc, multiline rendering should never render more than
max_lines().

Bug: 866720
Change-Id: I8b3cf652143d09c7e6d6bd1d8eb0b22714aa73a4
Reviewed-on: https://chromium-review.googlesource.com/1149409
Reviewed-by: Michael Wasserman <msw@chromium.org>
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578053}
[modify] https://crrev.com/b58163857fb749cbcd721ef7048cea0812796414/ui/gfx/render_text.cc
[modify] https://crrev.com/b58163857fb749cbcd721ef7048cea0812796414/ui/gfx/render_text.h
[modify] https://crrev.com/b58163857fb749cbcd721ef7048cea0812796414/ui/gfx/render_text_harfbuzz.cc

Blocking: -853281
This is no longer blocking  issue 853281  since homogeneous style works fine. The bug still exists otherwise.
Summary: gfx::RenderText::SetMaxLines not effective when using WRAP_LONG_WORDS (was: gfx::RenderText::SetMaxLines not effective when uding WRAP_LONG_WORDS)

Sign in to add a comment