目录
当前位置: 首页 > 文档资料 > Snap.svg 英文文档 >

Paper.rect(x, y, width, height, [rx], [ry])

优质
小牛编辑
118浏览
2023-12-01

Draws a rectangle

Parameters

  1. xnumberx coordinate of the top left corner
  2. ynumbery coordinate of the top left corner
  3. widthnumberwidth
  4. heightnumberheight
  5. rxnumberhorizontal radius for rounded corners,default is 0
  6. rynumbervertical radius for rounded corners,default is rx or 0

Returns: object the rect element

Usage

// regular rectangle
var c = paper.rect(10, 10, 50, 50);
// rectangle with rounded corners
var c = paper.rect(40, 40, 50, 50, 10);