mirror of
https://github.com/danbulant/cushy
synced 2026-06-21 15:42:07 +00:00
Clipping the checkerboard pattern
This commit is contained in:
parent
d701e179ae
commit
64ad120be6
1 changed files with 2 additions and 3 deletions
|
|
@ -344,12 +344,11 @@ impl ColorComponent for Alpha {
|
|||
);
|
||||
let mut y = Px::ZERO;
|
||||
let mut offset = false;
|
||||
let mut gfx = context.gfx.clipped_to(rect);
|
||||
while y < rect.size.height {
|
||||
let mut x = if offset { checker_size } else { Px::ZERO };
|
||||
while x < rect.size.width {
|
||||
context
|
||||
.gfx
|
||||
.draw_shape(shape.translate_by(rect.origin + Point::new(x, y)));
|
||||
gfx.draw_shape(shape.translate_by(Point::new(x, y)));
|
||||
x += checker_size * 2;
|
||||
}
|
||||
y += checker_size;
|
||||
|
|
|
|||
Loading…
Reference in a new issue