fix bug custom shape
This commit is contained in:
@@ -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 (0–1) instead of 0–100
|
||||
if (
|
||||
obj.opacity !== undefined &&
|
||||
obj.opacity > 0 &&
|
||||
obj.opacity <= 1
|
||||
) {
|
||||
baseObject.opacity = obj.opacity * 100;
|
||||
}
|
||||
}
|
||||
|
||||
return baseObject;
|
||||
return normalizeCustomShapeObject(baseObject);
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user