在 FabricJS 上缩放对象时如何停止控制边框填充增加?

How to stop control border padding increase when scaling an object on FabricJS?

如何在 FabricJS 上缩放对象时停止控制边框填充增加?

我有一个矩形

canvas = new fabric.Canvas('c', {
                backgroundColor: '#FFFFFF'
});

// create a rectangle object
var rect = new fabric.Rect({
  left: 200,
  top: 185,
  fill: 'red',
  width: 100,
  height: 100,
  padding: 0
});

https://jsfiddle.net/wwexsh1f/2/

Scaled Rectangle Image

当我使用 mouserect.scaleTo 函数缩放我的矩形时,控制边框填充也会增加,尽管填充设置为 0.

如何停止缩放时填充增加?

设置 strokeWidth = 0;

var rect = new fabric.Rect({
  left: 200,
  top: 185,
  fill: 'red',
  width: 100,
  height: 100,
  padding: 0,
  strokeWidth : 0
});

随对象缩放