Only define *existing* methods, when converting the OPS
format to method-names on the CanvasGraphics.prototype
There's no good reason, as far as I can tell, to explicitly define a bunch of methods to be `undefined`, which the current unconditional "copying" of methods will do. Note that of the `OPS` ~23 percent don't, for various reasons, have an associated method on the `CanvasGraphics.prototype`.
This commit is contained in:
parent
fbaafdc4e8
commit
e1fa845293
@ -2804,7 +2804,9 @@ class CanvasGraphics {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const op in OPS) {
|
for (const op in OPS) {
|
||||||
CanvasGraphics.prototype[OPS[op]] = CanvasGraphics.prototype[op];
|
if (CanvasGraphics.prototype[op] !== undefined) {
|
||||||
|
CanvasGraphics.prototype[OPS[op]] = CanvasGraphics.prototype[op];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { CanvasGraphics };
|
export { CanvasGraphics };
|
||||||
|
Loading…
Reference in New Issue
Block a user