[LayoutNG] Fix bounding box in ShapeResult::CopyRange
This patch fixes ShapeResult::CopyRange to compute more accurate glyph bounding box. There were 2 problems before this patch: 1. It always truncated the right edge. This is problematic when Copying (0, 1) of ". " in RTL, which resulted in an empty result. 2. It assumed no glyph overflow at the edge. This resulted in common glyph overflows such as "t" or "m" were cut off. This patch extracts the logic to compute glyph bounding box from ComputeGlyphPositions to a new helper class. CopyRange uses the class to compute the line-left/right most glyph bounding box. Bug: 636993, 714962 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: I7d2068566308081727c996e3ac0fe23aae6558d1 Reviewed-on: https://chromium-review.googlesource.com/1023536Reviewed-by:Emil A Eklund <eae@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#554645}
Showing
This diff is collapsed.
Please register or sign in to comment