From 37711ee0e3d4eb44305a624a62a3a2311c49c896 Mon Sep 17 00:00:00 2001 From: Mike Lynch Date: Mon, 6 Jan 2025 10:28:18 +1100 Subject: [PATCH] Diagonal gradients --- src/components/dots.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/dots.js b/src/components/dots.js index 4a64985..d121099 100644 --- a/src/components/dots.js +++ b/src/components/dots.js @@ -6,10 +6,10 @@ const RADIUS_OPTS = [ "left", "up", "down", - // "RU", - // "RD", - // "LU", - // "LD", + "RU", + "RD", + "LU", + "LD", // "circle" ]; @@ -53,6 +53,14 @@ class DotMaker { return maxr * d.y / this.width; case "up": return maxr * (this.width - d.y) / this.width; + case "RU": + return 0.5 * maxr * (d.x + this.width - d.y) / this.width; + case "LU": + return 0.5 * maxr * (this.width - d.x + this.width - d.y) / this.width; + case "RD": + return 0.5 * maxr * (d.x + d.y) / this.width; + case "LD": + return 0.5 * maxr * (this.width - d.x + d.y) / this.width; default: return maxr; }