fix bug custom shape

This commit is contained in:
hamid zarghami
2026-06-13 16:46:37 +03:30
parent 9447500725
commit ebb2092ec1
7 changed files with 171 additions and 34 deletions
+2 -9
View File
@@ -1,4 +1,5 @@
import type { EditorObject, TableData } from "@/pages/editor/store/editorStore";
import { normalizeCustomShapeObject } from "@/pages/editor/utils/customShape";
import type { PageData } from "../types";
type ViewerDataPage = {
@@ -170,17 +171,9 @@ export function transformViewerDataToPages(data: ViewerData): PageData[] {
if (obj.type === "custom-shape") {
if (obj.points !== undefined) baseObject.points = obj.points;
if (obj.closed !== undefined) baseObject.closed = obj.closed;
// Older custom shapes stored Konva opacity (01) instead of 0100
if (
obj.opacity !== undefined &&
obj.opacity > 0 &&
obj.opacity <= 1
) {
baseObject.opacity = obj.opacity * 100;
}
}
return baseObject;
return normalizeCustomShapeObject(baseObject);
});
return {