Diagonal gradients

rc-1.0.0
Mike Lynch 2025-01-06 10:28:18 +11:00
parent 22b02db4d4
commit 37711ee0e3
1 changed files with 12 additions and 4 deletions

View File

@ -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;
}