aboutsummaryrefslogtreecommitdiffstats
path: root/src/Rect.js
blob: 825adeb93aff80272401239b97b995b77cc5c393 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import Shape from './Shape.js'
import {nodeOrNew} from './tools.js'

export default class Rect extends Shape {
  // Initialize node
  constructor (node) {
    super(nodeOrNew('rect', node))
  }
}

addFactory(Parent, {
  // Create a rect element
  rect (width, height) {
    return this.put(new Rect()).size(width, height)
  }
})