Images filled in the shapes are not loading with l

2019-05-28 17:53发布

I have JSON data with fabric Rect object. When I try to load this JSON data on to fabric canvas with LoadFromJSON, Shapes are loading perfectly but patterns filled in the shapes are not rendering. The patterns are rendered only after clicking on shape.

I have copied my code in fabric Kitchen sink execute module and i tried to execute it. But it is also not working as expected.

My Code:

var jsonD = '{"objects":[{"type":"rect","originX":"center","originY":"center","left":222.92,"top":237,"width":100,"height":100,"fill":{"source":"http://www.convertingquarterly.com/Portals/1/images/industry-news/Brushfoil%20cross-hatch,%20Tru-Stainless%20paaterns.jpg","repeat":"repeat","offsetX":0,"offsetY":0},"overlayFill":null,"stroke":"black","strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeLineJoin":"miter","strokeMiterLimit":10,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,"selectable":true,"hasControls":true,"hasBorders":true,"hasRotatingPoint":true,"transparentCorners":true,"perPixelTargetFind":false,"shadow":null,"visible":true,"clipTo":null,"rx":0,"ry":0,"x":0,"y":0}],"background":""}';
canvas.loadFromJSON(jsonD);
canvas.renderAll();

How to solve this problem?

1条回答
女痞
2楼-- · 2019-05-28 18:33

I have just updated from 1.1.6 to 1.2.9 and my image assets are also not showing when using loadFromJson!

What the heck changed?!

查看更多
登录 后发表回答