Commit c428e693 authored by Stephen Chenney's avatar Stephen Chenney Committed by Commit Bot

Relax background tiling snapping

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: default avatarFredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#773223}
parent e0238a39
...@@ -472,10 +472,10 @@ void DrawTiledBackground(GraphicsContext& context, ...@@ -472,10 +472,10 @@ void DrawTiledBackground(GraphicsContext& context,
// //
// So detect when we do not want to repeat and set the scale to round the // So detect when we do not want to repeat and set the scale to round the
// values in that dimension. // 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()); 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()); scale.SetHeight(snapped_paint_rect.Height() / intrinsic_tile_size.Height());
} }
......
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