From b619c48236e620f272162e412525502355da144220f813f5c3ef8ea13b975ea1 Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Fri, 19 Apr 2024 00:00:00 +0000 Subject: Set first square to always opaque. This is so that the user always sees something, even for a 1x1 pattern. --- src/hitomezashi.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/hitomezashi.rs b/src/hitomezashi.rs index e8d4a65..7b74998 100644 --- a/src/hitomezashi.rs +++ b/src/hitomezashi.rs @@ -34,8 +34,8 @@ pub fn hitomezashi(width: usize, height: usize, skew: Option) { let mut rng = rand::thread_rng(); let brn = Bernoulli::new(skew).unwrap(); - // the first square (upper left corner) is always transparent - let init_bit: bool = true; + // the first square (upper left corner) is always opaque + let init_bit: bool = false; let mut row_bits: Vec = Vec::with_capacity(height - 1); -- cgit v1.2.3