路径错误位置的边界框
Bounding box of path wrong position
我在数据库中保存的几个路径有问题。事实证明,边界框完全偏离了物体。有人帮帮我吗?
路径示例:
{"objects":[{"type":"path","originX":"center","originY":"center","left":200,"top":100,"width":162.33,"height":162.33,"fill":"#D1D3D4","overlayFill":null,"stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeLineJoin":"miter","strokeMiterLimit":10,"scaleX":0.84,"scaleY":0.84,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"path":[["M",162.329,81.164],["c",0,44.826,-36.338,81.165,-81.164,81.165],["C",36.338,162.329,0,125.99,0,81.164],["C",0,36.338,36.338,0,81.165,0],["C",125.99,0,162.329,36.338,162.329,81.164],["z"]],"pathOffset":{"x":-81.165,"y":-81.165}}],"background":"#f7f7f7"}
这里是 fiddle:http://jsfiddle.net/3q61vmef/1/
发现错误。错误在 pathOffset
属性 中。需要通过如下替换将 x
和 y
值更改为零:
"pathOffset":{"x":0,"y":-81.165}
至:
"pathOffset":{"x":0,"y":0}
谢谢。
我在数据库中保存的几个路径有问题。事实证明,边界框完全偏离了物体。有人帮帮我吗?
路径示例:
{"objects":[{"type":"path","originX":"center","originY":"center","left":200,"top":100,"width":162.33,"height":162.33,"fill":"#D1D3D4","overlayFill":null,"stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeLineJoin":"miter","strokeMiterLimit":10,"scaleX":0.84,"scaleY":0.84,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"path":[["M",162.329,81.164],["c",0,44.826,-36.338,81.165,-81.164,81.165],["C",36.338,162.329,0,125.99,0,81.164],["C",0,36.338,36.338,0,81.165,0],["C",125.99,0,162.329,36.338,162.329,81.164],["z"]],"pathOffset":{"x":-81.165,"y":-81.165}}],"background":"#f7f7f7"}
这里是 fiddle:http://jsfiddle.net/3q61vmef/1/
发现错误。错误在 pathOffset
属性 中。需要通过如下替换将 x
和 y
值更改为零:
"pathOffset":{"x":0,"y":-81.165}
至:
"pathOffset":{"x":0,"y":0}
谢谢。