Skip to content

Commit bfb5e6e

Browse files
Merge pull request #4 from saschamuellercerpro/test-smth-out
remove daniels point retrieval function
2 parents ffbc7ee + a7338a1 commit bfb5e6e

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

src/components/Board/Board.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,8 @@ const Board = React.forwardRef<BoardActions, BoardProps>(
12601260
loadItems,
12611261
scaleRatio,
12621262
isInDrawingMode,
1263+
imageSize.width,
1264+
imageSize.height,
12631265
]);
12641266

12651267
// Update zoom parent value

src/fabric/utils.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,7 @@ export const toScaledCoord = ({
8383
*/
8484
export const pointsInCanvas = (obj?: fabricTypes.CustomObject) => {
8585
if (!obj) return [];
86-
if (!obj.points) {
87-
return obj.getCoords(true);
88-
}
89-
return (
90-
obj.points?.map((p) => {
91-
const matrix = obj.calcOwnMatrix();
92-
const minX = Math.min(...obj.points!.map((_p) => _p.x));
93-
const minY = Math.min(...obj.points!.map((_p) => _p.y));
94-
const tmpPoint = new fabric.Point(
95-
p.x - minX - obj.width! / 2,
96-
p.y - minY - obj.height! / 2,
97-
);
98-
return fabric.util.transformPoint(tmpPoint, matrix);
99-
}) ?? []
100-
);
86+
return obj.getCoords(true);
10187
};
10288

10389
/**

0 commit comments

Comments
 (0)