I am developing an app, which provides the design of Different shapes like Square and Circle, I have used the following Library
https://www.npmjs.com/package/react-native-draggable
At the time of creating my drawing view its working fine, but at the time of edit that drawing, I want to move Circle and Square from its previous saved position to its new position, but when I am trying to set my previous last position from the DB, I can't get perfect position of X and Y.
When I debug, I am getting touch position of the object, not the X and Y position of the object
this is my code :
I used draggable class for creating an object Draggable,
In my Component :
<Draggable renderSize={68} renderColor='rad' x={80.80097961425781} y={72.79156494140625} renderText='B' pressDrag={()=>alert('touched!!')} pressDragRelease={({ nativeEvent }) => { console.log(nativeEvent);}} reverse={false} />
Here is my Question:
1. How can I get X and Y from nativeElement
,
'nativeElement` property are : nativeEvent
ChangedTouches - Array of all touch events that have changed since the last eventidentifier - The ID of the touchlocationX - The X position of the touch, relative to the elementlocationY - The Y position of the touch, relative to the elementpageX - The X position of the touch, relative to the root elementpageY - The Y position of the touch, relative to the root elementtarget - The node id of the element receiving the touch eventtimestamp - A time identifier for the touch, useful for velocity calculationtouches - Array of all current touches on the screen