diff options
Diffstat (limited to 'src/Polyline.js')
-rw-r--r-- | src/Polyline.js | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/Polyline.js b/src/Polyline.js index 9c28438..c3c8c0c 100644 --- a/src/Polyline.js +++ b/src/Polyline.js @@ -1,19 +1,25 @@ -import Shape from './Shape.js' -import {nodeOrNew} from './tools.js' +import Base from './Base.js' +import {nodeOrNew, extend} from './tools.js' import PointArray from './PointArray.js' +import * as pointed from './pointed.js' +import * as poly from './poly.js' -export default class Polyline extends Shape { +export default class Polyline extends Base { // Initialize node constructor (node) { - super(nodeOrNew('polyline', node)) + super(nodeOrNew('polyline', node), Polyline) } } -// Add parent method -addFactory (Parent, { - // Create a wrapped polyline element - polyline (p) { - // make sure plot is called as a setter - return this.put(new Polyline()).plot(p || new PointArray()) +Polyline.constructors = { + Parent: { + // Create a wrapped polygon element + polyline (p) { + // make sure plot is called as a setter + return this.put(new Polyline()).plot(p || new PointArray()) + } } -}) +} + +extend(Polyline, pointed) +extend(Polyline, poly) |