scaleflex / filerobot-image-editor

Edit, resize, and filter any image! Any questions or issues, please report to https://github.com/scaleflex/filerobot-image-editor/issues
MIT License
1.26k stars 321 forks source link

Pen & loadableDesignState : the pen annotations are not handled inside the state #477

Open gautiermichelin opened 1 week ago

gautiermichelin commented 1 week ago

Hi Scaleflex team,

Pen & loadableDesignState : the pen annotations are not handled inside the state.

To reproduce, export a pen annotation through imageDesignState, you'll get inside the annotations property :

{"Pen-1184211639905": {
  "fill": "#ff0000",
  "stroke": "#ff0000",
  "strokeWidth": 5,
  "shadowOffsetX": 0,
  "shadowOffsetY": 0,
  "shadowBlur": 0,
  "shadowColor": "#000000",
  "shadowOpacity": 1,
  "opacity": 1,
  "tension": 0.5,
  "lineCap": "round",
  "selectAnnotationAfterDrawing": true,
  "name": "Pen",
  "id": "Pen-1184211639905",
  "points": [
      155.4268658835424,
      136.28386357581525,
      155.47852658052852,
      136.07457152135865
  ]
}
}

Points are the relative coordinates of the pen object, but its drawing is nowhere to be found, or I may have missed something.