Fix incorrect sign background-image rectangle computation

This commit is contained in:
Simon Sapin 2020-05-14 10:02:23 +02:00
parent 1f6efbf9e9
commit f53ac953d6

View file

@ -21,6 +21,7 @@ pub(super) struct BackgroundLayer {
pub repeat: bool,
}
#[derive(Debug)]
struct Layout1DResult {
repeat: bool,
bounds_origin: f32,
@ -250,7 +251,8 @@ fn layout_1d(
let tile_stride = *tile_size + tile_spacing;
let offset = position - painting_area_origin;
let bounds_origin = position - tile_stride * (offset / tile_stride).ceil();
let bounds_size = painting_area_size - bounds_origin - painting_area_origin;
let bounds_end = painting_area_origin + painting_area_size;
let bounds_size = bounds_end - bounds_origin;
Layout1DResult {
repeat: true,
bounds_origin,