reusing saved elements #1425
Unanswered
arifsuheyl
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Have you looked to |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I need to save elements to use later. I couldn't save Path elements in AsyncStorage and JSON.stringfy has some problems for this jsx.element. I decided to save data to draw elements again.
In TouchDrawing.tsx
*I saved x, y, color, size, pathType data from onStart case and use later in the line: drawContext.commands.addElement(createPath(x, y, color, size, pathType)); It is ok. Starting point is true.
*I saved prevPointRef.current!.x, prevPointRef.current!.y,xMid,yMid from onActive and use it element.path.quadTo later.
When I draw later with these data, draw is not smooth. What else do I need to save?
I found
export interface DrawingInfo {
width: number;
height: number;
timestamp: number;
touches: Array<Array>;
}
in types.ts but I couldn't find where width and height are used. You can see the difference in between drawings.
Please help me, thank you.
Beta Was this translation helpful? Give feedback.
All reactions