|
@@ -42,8 +42,8 @@ export const create = async (store, canvas) => {
|
|
|
const method = Object.fromEntries(
|
|
|
Object.keys(data).map((key) => [
|
|
|
`set${key.slice(0, 1).toUpperCase() + key.slice(1)}`,
|
|
|
- (value) => {
|
|
|
- update({ [key]: value });
|
|
|
+ (value, save = true) => {
|
|
|
+ update({ [key]: value, save });
|
|
|
},
|
|
|
])
|
|
|
);
|
|
@@ -57,7 +57,6 @@ export const create = async (store, canvas) => {
|
|
|
},
|
|
|
};
|
|
|
const update = (newData) => {
|
|
|
- Object.assign(shape.data, newData);
|
|
|
console.log("set", newData);
|
|
|
layer.uiControl.setAttributes(type, "update", { ...newData, version: 2 });
|
|
|
};
|
|
@@ -157,7 +156,7 @@ export const create = async (store, canvas) => {
|
|
|
|
|
|
const cctx = $canvas.getContext("2d");
|
|
|
cctx.rect(0, 0, $canvas.width, $canvas.height);
|
|
|
- cctx.fillStyle = 'rgba(255,255,255,1)';
|
|
|
+ cctx.fillStyle = "rgba(255,255,255,1)";
|
|
|
cctx.fill();
|
|
|
cctx.drawImage(canvas, 0, 0, $canvas.width, $canvas.height);
|
|
|
|