diff options
Diffstat (limited to 'src/elements/Polygon.js')
-rw-r--r-- | src/elements/Polygon.js | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/elements/Polygon.js b/src/elements/Polygon.js index 2288b75..afa5f31 100644 --- a/src/elements/Polygon.js +++ b/src/elements/Polygon.js @@ -11,28 +11,22 @@ import * as pointed from '../modules/core/pointed.js' import * as poly from '../modules/core/poly.js' export default class Polygon extends Shape { - // Initialize node - constructor ( node ) { - - super( nodeOrNew( 'polygon', node ), node ) - + constructor (node) { + super(nodeOrNew('polygon', node), node) } - } -registerMethods( { +registerMethods({ Container: { // Create a wrapped polygon element - polygon: wrapWithAttrCheck( function ( p ) { - + polygon: wrapWithAttrCheck(function (p) { // make sure plot is called as a setter - return this.put( new Polygon() ).plot( p || new PointArray() ) - - } ) + return this.put(new Polygon()).plot(p || new PointArray()) + }) } -} ) +}) -extend( Polygon, pointed ) -extend( Polygon, poly ) -register( Polygon ) +extend(Polygon, pointed) +extend(Polygon, poly) +register(Polygon) |