How to add active text outline to Fabric.js

I used canvas in html5 using js. I want to apply contours to the active text on the canvas. The following code I wrote works fine, but the problem is that I am increasing the thickness of the outline, then overlapping the text, which means the text color is fading.

activeObject1.stroke = color; activeObject1.strokeWidth = 5; 

and one more thing, applying this, I cannot apply the 2nd circuit. I have one example, but it does not work with fabricjs.

 http://jsfiddle.net/vNWn6/ 
+4
source share
1 answer
 var active_obj = canvas.getActiveObject(); active_obj.stroke = '#000'; active_obj.strokeWidth = 5; canvas.renderAll(); 
0
source

Source: https://habr.com/ru/post/1497373/


All Articles