Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一些字符串演示Path。我想在字符串表示中移动路径对象。例如,我继续前进"M 10,100 C 100,0 200,200 300,100"并(5, 0)获得"M 15,100 C 105,0 205,200 305,100". 有标准的方法吗?
Path
"M 10,100 C 100,0 200,200 300,100"
(5, 0)
"M 15,100 C 105,0 205,200 305,100"
最简单的方法是使用小写版本的命令定义路径中相对于当前点的所有坐标:
"M 100,0 c 0,0 200,200 300,100"
这样你只需要改变初始的移动坐标,整个形状就会受到影响。
没有任何内置或“标准”。
您将需要解析字符串(或反序列化),进行更新并输出结果。