Skip to content

Commit

Permalink
Relax background tiling snapping
Browse files Browse the repository at this point in the history
The previous fix for backgrounds repeating when they shouldn't
was too restrictive and still allowed backgrounds to repeat at
some zoom levels. Switch from "<" to "<=" to snap the remaining
cases.

Bug: 1085801
Change-Id: Iedf79fa9980ade753b4ca108d7462b282652eeeb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2222540
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Auto-Submit: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#773223}
  • Loading branch information
schenney-chromium authored and Commit Bot committed May 29, 2020
1 parent e0238a3 commit c428e69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions third_party/blink/renderer/core/paint/box_painter_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,10 @@ void DrawTiledBackground(GraphicsContext& context,
//
// So detect when we do not want to repeat and set the scale to round the
// values in that dimension.
if (fabs(tile_size.Width() - snapped_paint_rect.Width()) < 0.5) {
if (fabs(tile_size.Width() - snapped_paint_rect.Width()) <= 0.5) {
scale.SetWidth(snapped_paint_rect.Width() / intrinsic_tile_size.Width());
}
if (fabs(tile_size.Height() - snapped_paint_rect.Height()) < 0.5) {
if (fabs(tile_size.Height() - snapped_paint_rect.Height()) <= 0.5) {
scale.SetHeight(snapped_paint_rect.Height() / intrinsic_tile_size.Height());
}

Expand Down

0 comments on commit c428e69

Please sign in to comment.