fix line and peykan in viwer

This commit is contained in:
hamid zarghami
2026-01-07 10:18:09 +03:30
parent 9237bf0ba4
commit 84b8d3801d
2 changed files with 7 additions and 5 deletions
+2
View File
@@ -249,6 +249,7 @@ const BookPage = forwardRef<HTMLDivElement, BookPageProps>(({ page, scale = 1 },
// در Konva Line، points به صورت [0, 0, endX - startX, endY - startY] است
const startX = (obj.x || 0) * scale;
const startY = (obj.y || 0) * scale;
// width و height مستقیماً مختصات نقطه پایان هستند
const endX = (obj.width ?? obj.x ?? 0) * scale;
const endY = (obj.height ?? obj.y ?? 0) * scale;
const dx = endX - startX;
@@ -279,6 +280,7 @@ const BookPage = forwardRef<HTMLDivElement, BookPageProps>(({ page, scale = 1 },
// در Konva Arrow، points به صورت [0, 0, endX - startX, endY - startY] است
const startX = (obj.x || 0) * scale;
const startY = (obj.y || 0) * scale;
// width و height مستقیماً مختصات نقطه پایان هستند
const endX = (obj.width ?? obj.x ?? 0) * scale;
const endY = (obj.height ?? obj.y ?? 0) * scale;
const dx = endX - startX;