Skip to content

椭圆

PropertyDescriptionTypeRequiredDefault
rxx 轴半径numbertrue0
ryy 轴半径numbertrue0
fill填充颜色string | Gradientfalse-
stroke描边颜色stringfalse-
strokeWidth描边宽度numberfalse1
strokeDashArray描边点划线number[]false-
strokeDashOffset描边点划线偏移numberfalse0
strokeLineCap开放自路径两端的形状CanvasLineCapfalse-
strokeLineJoin转角处形状CanvasLineJoinfalse-
strokeMiterLimit转角最大距离numberfalse4

示例

Source Code
js
const rubbing = new Rubbing({
  selector: '#canvas',
  background: '#fff',
  width: 200,
  height: 100,
})
await rubbing.init()
rubbing.loadFrom({
  objects: [
    {
      type: 'ellipse',
      left: 100,
      top: 50,
      rx: 100,
      ry: 50,
      fill: '#7c3aed',
    },
  ],
})