aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/core/pointed.js
blob: 813b0e349f2e263507d50a77f6d3e4ee8207620a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import PointArray from '../../types/PointArray.js'

export let MorphArray = PointArray

// Move by left top corner over x-axis
export function x ( x ) {

  return x == null ? this.bbox().x : this.move( x, this.bbox().y )

}

// Move by left top corner over y-axis
export function y ( y ) {

  return y == null ? this.bbox().y : this.move( this.bbox().x, y )

}

// Set width of element
export function width ( width ) {

  let b = this.bbox()
  return width == null ? b.width : this.size( width, b.height )

}

// Set height of element
export function height ( height ) {

  let b = this.bbox()
  return height == null ? b.height : this.size( b.width, height )

}