Merge pull request 'Fix onPaint for widgets' (#1658) from fix-onpaint into main

Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1658
This commit is contained in:
Alex McLean 2025-10-22 16:20:49 +02:00
commit ac37b6a029

View file

@ -84,9 +84,18 @@ Pattern.prototype.onPaint = function (painter) {
state.controls.painters = [];
}
state.controls.painters.push(painter);
return state;
});
};
// TODO - Why isn't this pure deep copy not working?
// Pattern.prototype.onPaint = function (painter) {
// return this.withState((state) => {
// const painters = state.controls.painters ? [...state.controls.painters, painter] : [painter];
// return new State(state.span, { ...state.controls, painters });
// });
// };
Pattern.prototype.getPainters = function () {
let painters = [];
this.queryArc(0, 0, { painters });