79293403

Date: 2024-12-19 07:29:43
Score: 1.5
Natty:
Report link

2024 version based on fabric 6.4.3 and @VitaliiBratok answer:

polygon.on('modified', (o) => {
      const newCoords = polygon.get('points')
        .map(
          (p: Point) =>
            new Point(p.x - polygon.pathOffset.x, p.y - polygon.pathOffset.y),
        )
        .map((p: Point) => util.transformPoint(p, polygon.calcTransformMatrix()));

         polygon.set({'points': newCoords });
        // (...)
});
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @VitaliiBratok
  • Low reputation (1):
Posted by: TheSinOfGreed