我在改變Rectangle,Circle和Image的筆觸顏色或描邊寬度時遇到了錯誤。每當我改變這些值時,邊界就成指數級的大。關於更改矩形,圓和圖像在Fabric.js中的stroke或strokeWidth時出錯
var obj = canvas.getActiveObject();
obj.set("stroke", stroke);
obj.set("strokeWidth", strokeWidth);
canvas.renderAll();
我使用這段代碼來設置這些屬性。
Image 1 shows the circle I added to canvas.
Image 2 shows the increased border after I change stroke color.
只有當我嘗試設置strokeWidth時纔會更新這種情況 –
控件變得瘋狂是我試圖調整圖像的大小 –