Allow line points to be of type TypedArray.

This commit is contained in:
Tim de Koning
2022-08-08 12:19:47 +02:00
parent ccf9d922cf
commit 01134dcf2a
2 changed files with 4 additions and 1 deletions

View File

@@ -142,6 +142,9 @@ export function getFunctionValidator() {
export function getNumberArrayValidator() {
if (Konva.isUnminified) {
return function (val: any, attr: string) {
if (val instanceof Uint8Array || val instanceof Uint16Array || val instanceof Uint32Array || val instanceof Uint8ClampedArray) {
return val
}
if (!Util._isArray(val)) {
Util.warn(
_formatValue(val) +

View File

@@ -51,7 +51,7 @@ function expandPoints(p, tension) {
}
export interface LineConfig extends ShapeConfig {
points?: number[];
points?: number[] | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray;
tension?: number;
closed?: boolean;
bezier?: boolean;