我正在使用下面的代码来更改选定形状的选定边框和边框颜色,但是一旦我调用该事件对象就会变小并且不会重新调整大小。
$('#shape_border_colour').spectrum({
color : "#f00",
change : function(color) {
console.log(' color change' + color.toHexString());
var obj = canvas.getActiveObject();
shape_strokeColor=color.toHexString();
if (!obj)
return;
obj.set('stroke', shape_strokeColor);
obj.set('strokeWidth',shape_strokeWidth);
//stroke : 'white',
//strokeWidth : 5
//obj.set('textBackgroundColor', color.toHexString());
canvas.renderAll();
}
});
$('#shape_border_size').change(function() {
console.log(' size changed to ' + $(this).val());
img_border = $(this).val();
var obj = canvas.getActiveObject();
shape_strokeWidth=$(this).val();
if (!obj)
return;
obj.set('stroke',shape_strokeColor );
obj.set('strokeWidth', shape_strokeWidth);
canvas.renderAll();
});
会有什么问题?