make spiral size param 3 in one

This commit is contained in:
Felix Roos 2024-03-23 12:26:32 +01:00
parent 21f5d639a3
commit 49e381f258

View File

@ -115,7 +115,8 @@ registerWidget('_punchcard', (id, options = {}, pat) => {
});
registerWidget('_spiral', (id, options = {}, pat) => {
options = { width: 200, height: 200, size: 36, ...options };
let _size = options.size || 275;
options = { width: _size, height: _size, ...options, size: _size / 5 };
const ctx = getCanvasWidget(id, options).getContext('2d');
return pat.id(id).spiral({ ...options, ctx, id });
});