From 2daab678d45f400408a8dbdb39555c916c21ada6 Mon Sep 17 00:00:00 2001 From: Nick Baker Date: Sat, 5 Aug 2023 22:48:14 -0700 Subject: [PATCH] cleanup and extra bound filter --- string-bean/src/lib.rs | 1 + web/src/routes/+page.svelte | 10 ++++++---- web/tailwind.config.js | 1 - 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/string-bean/src/lib.rs b/string-bean/src/lib.rs index f859b9f..09b0de0 100644 --- a/string-bean/src/lib.rs +++ b/string-bean/src/lib.rs @@ -143,6 +143,7 @@ where (self.line_algorithm)(src.0, src.1, dst.0, dst.1) .into_iter() .filter(|((x, y), _)| *x < self.image_width && *y < self.image_height) + .filter(|((x, y), _)| *x + *y * self.image_height < self.image_mask_inverted.len()) .collect() } } diff --git a/web/src/routes/+page.svelte b/web/src/routes/+page.svelte index c33a768..09021ed 100644 --- a/web/src/routes/+page.svelte +++ b/web/src/routes/+page.svelte @@ -47,6 +47,8 @@ return circle_anchors(num_anchors, width, height, Math.min(width, height) / 2); case SHAPES.RECTANGLE: return rectangle_anchors(num_anchors, width, height); + default: + return circle_anchors(num_anchors, width, height, Math.min(width, height) / 2); } } @@ -188,7 +190,7 @@ {#if state == STATES.UPLOAD}
-

string-bean

+

🧵string-bean

+ +

🧵string-bean

{/if} diff --git a/web/tailwind.config.js b/web/tailwind.config.js index edab23c..ef0bc70 100644 --- a/web/tailwind.config.js +++ b/web/tailwind.config.js @@ -2,7 +2,6 @@ module.exports = { mode: 'jit', content: ['./src/**/*.{html,js,svelte,ts}'], - darkMode: false, // or 'media' or 'class' theme: {}, daisyui: { themes: ["night"],