Skip to content

Commit 541db5c

Browse files
authored
custom block shape addon -- notch support [REAL]
1 parent f4f3c8c commit 541db5c

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/addons/addons/custom-block-shape/userscript.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,13 @@ export default async function ({ addon, console }) {
9292
`c -1 ${-1 * notchSize} -2 ${-2 * notchSize} -4 ${-2 * notchSize} `
9393

9494
/* Custom Notch API Support */
95-
const adjustedNotchSize = cornerSize * notchSize * (multiplier - 0.28);
95+
const adjustedNotchSize = (paddingSize > 1 ? paddingSize - 0.05 :
96+
paddingSize < 1 ? paddingSize + 0.05 : paddingSize) + ((cornerSize - 1) / 10);
9697
BlockSvg.CUSTOM_NOTCHES.forEach((notch) => {
9798
if (!notch.ogLeft) notch.ogLeft = notch.left;
9899
if (!notch.ogRight) notch.ogRight = notch.right;
99-
if (window.test) {
100-
window.test2 = applyChanges;
101-
console.log("N", notchSize, "M", multiplier, "C", cornerSize);
102-
notch.left = scalePathXY(notch.ogLeft, window.test[0], window.test[1]);
103-
notch.right = scalePathXY(notch.ogRight, window.test[0], window.test[1]);
104-
} else {
105-
notch.left = scalePathXY(notch.ogLeft, adjustedNotchSize, notchSize * multiplier);
106-
notch.right = scalePathXY(notch.ogRight, adjustedNotchSize, notchSize * multiplier);
107-
}
100+
notch.left = scalePathXY(notch.ogLeft, adjustedNotchSize, notchSize);
101+
notch.right = scalePathXY(notch.ogRight, adjustedNotchSize, notchSize);
108102
});
109103

110104
/* Custom Shape API Support */

0 commit comments

Comments
 (0)