summaryrefslogtreecommitdiffstats
path: root/src/modules/core/gradiented.js
blob: dd9c46f868df1ff04da3096aae657eaac2a073a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import SVGNumber from '../../types/SVGNumber.js'

export function from ( x, y ) {

  return ( this._element || this ).type === 'radialGradient'
    ? this.attr( { fx: new SVGNumber( x ), fy: new SVGNumber( y ) } )
    : this.attr( { x1: new SVGNumber( x ), y1: new SVGNumber( y ) } )

}

export function to ( x, y ) {

  return ( this._element || this ).type === 'radialGradient'
    ? this.attr( { cx: new SVGNumber( x ), cy: new SVGNumber( y ) } )
    : this.attr( { x2: new SVGNumber( x ), y2: new SVGNumber( y ) } )

}