fabricjs - How to set a stroke on only certain side? -
is there way give stroke on 1 side of canvas object? example want give stroke top.
when apply "strokewidth:1"
, it's applied on sides. haven't found property or method resolve problem.
there's no method it, defined sides. can add rectangle behind image , make border. example "top border" width 10px
:
var canvas = new fabric.canvas('c'); var radius = 150; fabric.image.fromurl('http://cdn.younghollywood.com/images/stories/newsimg/wenn/20140901/wenn21338105_46_4145_8.jpg', function(oimg) { oimg.scale(1.0).set({ left: 50, top: 50, width: 200, height: 200 }); canvas.add(oimg); canvas.renderall(); }); var border = new fabric.rect({ width: 200, height: 200+10, left: 50, top: 40, fill: "#ffffff" }); canvas.add(border); canvas.renderall();
fiddle: http://jsfiddle.net/q6y6k/11/
otherwise, please check this: how set stroke-width:1 on sides of svg shapes?
Comments
Post a Comment