summaryrefslogtreecommitdiffstats
path: root/src/elements/Polygon.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/elements/Polygon.js')
-rw-r--r--src/elements/Polygon.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/elements/Polygon.js b/src/elements/Polygon.js
index a7bf592..afa5f31 100644
--- a/src/elements/Polygon.js
+++ b/src/elements/Polygon.js
@@ -1,4 +1,9 @@
-import { extend, nodeOrNew, register } from '../utils/adopter.js'
+import {
+ extend,
+ nodeOrNew,
+ register,
+ wrapWithAttrCheck
+} from '../utils/adopter.js'
import { registerMethods } from '../utils/methods.js'
import PointArray from '../types/PointArray.js'
import Shape from './Shape.js'
@@ -15,10 +20,10 @@ export default class Polygon extends Shape {
registerMethods({
Container: {
// Create a wrapped polygon element
- polygon (p) {
+ polygon: wrapWithAttrCheck(function (p) {
// make sure plot is called as a setter
return this.put(new Polygon()).plot(p || new PointArray())
- }
+ })
}
})