Javascript FabricJ在某些事件不起作用时更改边框大小和颜色

Javascript FabricJ在某些事件不起作用时更改边框大小和颜色,javascript,jquery,css,canvas,fabricjs,Javascript,Jquery,Css,Canvas,Fabricjs,我正在使用下面的代码来更改选定的边框和选定形状的边框颜色,但一旦我调用该事件对象,它的大小将变小,并且不会再变大 $('#shape_border_colour').spectrum({ color : "#f00", change : function(color) { console.log(' color change' + color.toHexString()); var obj = canvas.ge

我正在使用下面的代码来更改选定的边框和选定形状的边框颜色,但一旦我调用该事件对象,它的大小将变小,并且不会再变大

$('#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();

    });

问题出在哪里?

我通过执行parseInt(shape_strokeWidth)解决了这个问题,strokeWidth接受数字值我做错的是传递字符串