I have string presentation of some Path
. I want to move path object in string presentation开发者_运维百科. For example I move "M 10,100 C 100,0 200,200 300,100"
on (5, 0)
and get "M 15,100 C 105,0 205,200 305,100"
. There is standart method for this?
The easiest way to do this is to define all coordinates in the path relative to the current point, by using the lowercase version of the commands:
"M 100,0 c 0,0 200,200 300,100"
this way you only need to change the initial Move coordinates and the entire shape will be affected.
There is nothing built in or "standard".
You will need to parse the string (or deserialize it), make the updates and output the result.
精彩评论