mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-24 03:58:53 +00:00
rename a to angle
This commit is contained in:
parent
88e8368022
commit
0a0a761e23
@ -22,11 +22,11 @@ Pattern.prototype.animate = function ({ callback, sync = false, smear = 0.5 } =
|
|||||||
ctx.fillStyle = clearColor;
|
ctx.fillStyle = clearColor;
|
||||||
ctx.fillRect(0, 0, ww, wh);
|
ctx.fillRect(0, 0, ww, wh);
|
||||||
frame.forEach((f) => {
|
frame.forEach((f) => {
|
||||||
let { x, y, w, h, s, r, a = 0, fill = 'darkseagreen' } = f.value;
|
let { x, y, w, h, s, r, angle = 0, fill = 'darkseagreen' } = f.value;
|
||||||
w *= ww;
|
w *= ww;
|
||||||
h *= wh;
|
h *= wh;
|
||||||
if (r !== undefined && a !== undefined) {
|
if (r !== undefined && angle !== undefined) {
|
||||||
const radians = a * 2 * Math.PI;
|
const radians = angle * 2 * Math.PI;
|
||||||
const [cx, cy] = [(ww - w) / 2, (wh - h) / 2];
|
const [cx, cy] = [(ww - w) / 2, (wh - h) / 2];
|
||||||
x = cx + Math.cos(radians) * r * cx;
|
x = cx + Math.cos(radians) * r * cx;
|
||||||
y = cy + Math.sin(radians) * r * cy;
|
y = cy + Math.sin(radians) * r * cy;
|
||||||
@ -51,7 +51,7 @@ Pattern.prototype.animate = function ({ callback, sync = false, smear = 0.5 } =
|
|||||||
return silence;
|
return silence;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const { x, y, w, h, a, r, fill, smear } = createParams('x', 'y', 'w', 'h', 'a', 'r', 'fill', 'smear');
|
export const { x, y, w, h, angle, r, fill, smear } = createParams('x', 'y', 'w', 'h', 'angle', 'r', 'fill', 'smear');
|
||||||
|
|
||||||
export const rescale = register('rescale', function (f, pat) {
|
export const rescale = register('rescale', function (f, pat) {
|
||||||
return pat.mul(x(f).w(f).y(f).h(f));
|
return pat.mul(x(f).w(f).y(f).h(f));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user