@visactor/vrender-core 0.22.0-vstory.5 → 0.22.0-vstory.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,7 +25,7 @@ class CustomSymbolClass {
25
25
  return (0, vutils_1.isNumber)(size) ? size : Math.min(size[0], size[1]);
26
26
  }
27
27
  drawWithClipRange(ctx, size, x, y, clipRange, z, cb) {
28
- return this.isSvg ? !!this.svgCache && (this.svgCache.forEach((item => {
28
+ return size = this.parseSize(size), this.isSvg ? !!this.svgCache && (this.svgCache.forEach((item => {
29
29
  item.path.drawWithClipRange(ctx, size, x, y, clipRange), cb && cb(item.path, item.attribute);
30
30
  })), !1) : (this.path.drawWithClipRange(ctx, size, x, y, clipRange), !1);
31
31
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/builtin-symbol/utils.ts"],"names":[],"mappings":";;;AAAA,6CAA+E;AAC/E,0EAAqE;AAGrE,MAAM,UAAU,GAAG,IAAI,mBAAU,EAAE,CAAC;AACpC,MAAa,iBAAiB;IAO5B,YACE,IAAY,EACZ,IAAsF,EACtF,QAAiB,KAAK;QAPxB,YAAO,GAAW,EAAE,CAAC;QASnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,IAAA,gBAAO,EAAC,IAAI,CAAC,EAAE;YACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;SACtB;aAAM;YACL,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;SAClB;QACD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,UAAU,CACR,GAAe,EACf,IAAY,EACZ,CAAS,EACT,CAAS,EACT,MAAc,EACd,CAAU,EACV,EAAmE;QAEnE,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC5B,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAClB,OAA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AC,IAAI,CAAC,MAAM,EAAE;YACrB,OAAO;SACR;QACD,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;IACzC,CAAC;CACF;AA9GD,8CA8GC","file":"utils.js","sourcesContent":["import { isArray, type IBounds, AABBBounds, isNumber } from '@visactor/vutils';\nimport { renderCommandList } from '../../common/render-command-list';\nimport type { IContext2d, ICustomPath2D, IGraphicAttribute, IPath2D, ISymbolClass } from '../../interface';\n\nconst tempBounds = new AABBBounds();\nexport class CustomSymbolClass implements ISymbolClass {\n type: string;\n path: ICustomPath2D;\n pathStr: string = '';\n isSvg: boolean;\n svgCache?: { path: ICustomPath2D; attribute: Partial<IGraphicAttribute> }[];\n\n constructor(\n type: string,\n path: ICustomPath2D | { path: ICustomPath2D; attribute: Partial<IGraphicAttribute> }[],\n isSvg: boolean = false\n ) {\n this.type = type;\n if (isArray(path)) {\n this.svgCache = path;\n } else {\n this.path = path;\n }\n this.isSvg = isSvg;\n }\n\n drawOffset(\n ctx: IContext2d,\n size: number,\n x: number,\n y: number,\n offset: number,\n z?: number,\n cb?: (path: ICustomPath2D, attribute?: Record<string, any>) => void\n ) {\n size = this.parseSize(size);\n if (this.isSvg) {\n if (!this.svgCache) {\n return false;\n }\n this.svgCache.forEach(item => {\n ctx.beginPath();\n renderCommandList(item.path.commandList, ctx, x, y, size, size);\n cb && cb(item.path, item.attribute);\n });\n return false;\n }\n renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset);\n return false;\n }\n\n draw(\n ctx: IContext2d,\n size: number,\n x: number,\n y: number,\n z?: number,\n cb?: (path: ICustomPath2D, attribute?: Record<string, any>) => void\n ) {\n size = this.parseSize(size);\n return this.drawOffset(ctx, size, x, y, 0, z, cb);\n }\n\n protected parseSize(size: number | [number, number]): number {\n return isNumber(size) ? size : Math.min(size[0], size[1]);\n }\n drawWithClipRange(\n ctx: IPath2D,\n size: number,\n x: number,\n y: number,\n clipRange: number,\n z?: number,\n cb?: (p: ICustomPath2D, a: any) => void\n ) {\n if (this.isSvg) {\n if (!this.svgCache) {\n return false;\n }\n this.svgCache.forEach(item => {\n item.path.drawWithClipRange(ctx, size, x, y, clipRange);\n cb && cb(item.path, item.attribute);\n });\n return false;\n }\n this.path.drawWithClipRange(ctx, size, x, y, clipRange);\n // this.path.drawWithClipRange && this.path.drawWithClipRange(ctx, clipRange);\n // renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset);\n return false;\n }\n\n bounds(size: number, bounds: IBounds) {\n size = this.parseSize(size);\n if (this.isSvg) {\n if (!this.svgCache) {\n return;\n }\n bounds.clear();\n this.svgCache.forEach(({ path }) => {\n tempBounds.x1 = path.bounds.x1 * size;\n tempBounds.y1 = path.bounds.y1 * size;\n tempBounds.x2 = path.bounds.x2 * size;\n tempBounds.y2 = path.bounds.y2 * size;\n bounds.union(tempBounds);\n });\n return;\n }\n if (!this.path.bounds) {\n return;\n }\n bounds.x1 = this.path.bounds.x1 * size;\n bounds.y1 = this.path.bounds.y1 * size;\n bounds.x2 = this.path.bounds.x2 * size;\n bounds.y2 = this.path.bounds.y2 * size;\n }\n}\n\n// export function CustomSymbol(): ISymbolClass {\n\n// }\n"]}
1
+ {"version":3,"sources":["../src/graphic/builtin-symbol/utils.ts"],"names":[],"mappings":";;;AAAA,6CAA+E;AAC/E,0EAAqE;AAGrE,MAAM,UAAU,GAAG,IAAI,mBAAU,EAAE,CAAC;AACpC,MAAa,iBAAiB;IAO5B,YACE,IAAY,EACZ,IAAsF,EACt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CAAC,IAAI,CAAC,QAAQ,EAAE;gBAClB,OAAO;aACR;YACD,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;gBACjC,UAAU,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;gBACtC,UAAU,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;gBACtC,UAAU,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;gBACtC,UAAU,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;gBACtC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;YACH,OAAO;SACR;QACD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACrB,OAAO;SACR;QACD,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;IACzC,CAAC;CACF;AA/GD,8CA+GC","file":"utils.js","sourcesContent":["import { isArray, type IBounds, AABBBounds, isNumber } from '@visactor/vutils';\nimport { renderCommandList } from '../../common/render-command-list';\nimport type { IContext2d, ICustomPath2D, IGraphicAttribute, IPath2D, ISymbolClass } from '../../interface';\n\nconst tempBounds = new AABBBounds();\nexport class CustomSymbolClass implements ISymbolClass {\n type: string;\n path: ICustomPath2D;\n pathStr: string = '';\n isSvg: boolean;\n svgCache?: { path: ICustomPath2D; attribute: Partial<IGraphicAttribute> }[];\n\n constructor(\n type: string,\n path: ICustomPath2D | { path: ICustomPath2D; attribute: Partial<IGraphicAttribute> }[],\n isSvg: boolean = false\n ) {\n this.type = type;\n if (isArray(path)) {\n this.svgCache = path;\n } else {\n this.path = path;\n }\n this.isSvg = isSvg;\n }\n\n drawOffset(\n ctx: IContext2d,\n size: number,\n x: number,\n y: number,\n offset: number,\n z?: number,\n cb?: (path: ICustomPath2D, attribute?: Record<string, any>) => void\n ) {\n size = this.parseSize(size);\n if (this.isSvg) {\n if (!this.svgCache) {\n return false;\n }\n this.svgCache.forEach(item => {\n ctx.beginPath();\n renderCommandList(item.path.commandList, ctx, x, y, size, size);\n cb && cb(item.path, item.attribute);\n });\n return false;\n }\n renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset);\n return false;\n }\n\n draw(\n ctx: IContext2d,\n size: number,\n x: number,\n y: number,\n z?: number,\n cb?: (path: ICustomPath2D, attribute?: Record<string, any>) => void\n ) {\n size = this.parseSize(size);\n return this.drawOffset(ctx, size, x, y, 0, z, cb);\n }\n\n protected parseSize(size: number | [number, number]): number {\n return isNumber(size) ? size : Math.min(size[0], size[1]);\n }\n drawWithClipRange(\n ctx: IPath2D,\n size: number,\n x: number,\n y: number,\n clipRange: number,\n z?: number,\n cb?: (p: ICustomPath2D, a: any) => void\n ) {\n size = this.parseSize(size);\n if (this.isSvg) {\n if (!this.svgCache) {\n return false;\n }\n this.svgCache.forEach(item => {\n item.path.drawWithClipRange(ctx, size, x, y, clipRange);\n cb && cb(item.path, item.attribute);\n });\n return false;\n }\n this.path.drawWithClipRange(ctx, size, x, y, clipRange);\n // this.path.drawWithClipRange && this.path.drawWithClipRange(ctx, clipRange);\n // renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset);\n return false;\n }\n\n bounds(size: number, bounds: IBounds) {\n size = this.parseSize(size);\n if (this.isSvg) {\n if (!this.svgCache) {\n return;\n }\n bounds.clear();\n this.svgCache.forEach(({ path }) => {\n tempBounds.x1 = path.bounds.x1 * size;\n tempBounds.y1 = path.bounds.y1 * size;\n tempBounds.x2 = path.bounds.x2 * size;\n tempBounds.y2 = path.bounds.y2 * size;\n bounds.union(tempBounds);\n });\n return;\n }\n if (!this.path.bounds) {\n return;\n }\n bounds.x1 = this.path.bounds.x1 * size;\n bounds.y1 = this.path.bounds.y1 * size;\n bounds.x2 = this.path.bounds.x2 * size;\n bounds.y2 = this.path.bounds.y2 * size;\n }\n}\n\n// export function CustomSymbol(): ISymbolClass {\n\n// }\n"]}
package/dist/index.es.js CHANGED
@@ -16914,6 +16914,7 @@ class CustomSymbolClass {
16914
16914
  return isNumber(size) ? size : Math.min(size[0], size[1]);
16915
16915
  }
16916
16916
  drawWithClipRange(ctx, size, x, y, clipRange, z, cb) {
16917
+ size = this.parseSize(size);
16917
16918
  if (this.isSvg) {
16918
16919
  if (!this.svgCache) {
16919
16920
  return false;
@@ -23,7 +23,7 @@ export class CustomSymbolClass {
23
23
  return isNumber(size) ? size : Math.min(size[0], size[1]);
24
24
  }
25
25
  drawWithClipRange(ctx, size, x, y, clipRange, z, cb) {
26
- return this.isSvg ? !!this.svgCache && (this.svgCache.forEach((item => {
26
+ return size = this.parseSize(size), this.isSvg ? !!this.svgCache && (this.svgCache.forEach((item => {
27
27
  item.path.drawWithClipRange(ctx, size, x, y, clipRange), cb && cb(item.path, item.attribute);
28
28
  })), !1) : (this.path.drawWithClipRange(ctx, size, x, y, clipRange), !1);
29
29
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/builtin-symbol/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAgB,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAGrE,MAAM,UAAU,GAAG,IAAI,UA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,CAAC,QAAQ,EAAE;gBAClB,OAAO;aACR;YACD,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;gBACjC,UAAU,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;gBACtC,UAAU,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;gBACtC,UAAU,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;gBACtC,UAAU,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;gBACtC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;YACH,OAAO;SACR;QACD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACrB,OAAO;SACR;QACD,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;IACzC,CAAC;CACF","file":"utils.js","sourcesContent":["import { isArray, type IBounds, AABBBounds, isNumber } from '@visactor/vutils';\nimport { renderCommandList } from '../../common/render-command-list';\nimport type { IContext2d, ICustomPath2D, IGraphicAttribute, IPath2D, ISymbolClass } from '../../interface';\n\nconst tempBounds = new AABBBounds();\nexport class CustomSymbolClass implements ISymbolClass {\n type: string;\n path: ICustomPath2D;\n pathStr: string = '';\n isSvg: boolean;\n svgCache?: { path: ICustomPath2D; attribute: Partial<IGraphicAttribute> }[];\n\n constructor(\n type: string,\n path: ICustomPath2D | { path: ICustomPath2D; attribute: Partial<IGraphicAttribute> }[],\n isSvg: boolean = false\n ) {\n this.type = type;\n if (isArray(path)) {\n this.svgCache = path;\n } else {\n this.path = path;\n }\n this.isSvg = isSvg;\n }\n\n drawOffset(\n ctx: IContext2d,\n size: number,\n x: number,\n y: number,\n offset: number,\n z?: number,\n cb?: (path: ICustomPath2D, attribute?: Record<string, any>) => void\n ) {\n size = this.parseSize(size);\n if (this.isSvg) {\n if (!this.svgCache) {\n return false;\n }\n this.svgCache.forEach(item => {\n ctx.beginPath();\n renderCommandList(item.path.commandList, ctx, x, y, size, size);\n cb && cb(item.path, item.attribute);\n });\n return false;\n }\n renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset);\n return false;\n }\n\n draw(\n ctx: IContext2d,\n size: number,\n x: number,\n y: number,\n z?: number,\n cb?: (path: ICustomPath2D, attribute?: Record<string, any>) => void\n ) {\n size = this.parseSize(size);\n return this.drawOffset(ctx, size, x, y, 0, z, cb);\n }\n\n protected parseSize(size: number | [number, number]): number {\n return isNumber(size) ? size : Math.min(size[0], size[1]);\n }\n drawWithClipRange(\n ctx: IPath2D,\n size: number,\n x: number,\n y: number,\n clipRange: number,\n z?: number,\n cb?: (p: ICustomPath2D, a: any) => void\n ) {\n if (this.isSvg) {\n if (!this.svgCache) {\n return false;\n }\n this.svgCache.forEach(item => {\n item.path.drawWithClipRange(ctx, size, x, y, clipRange);\n cb && cb(item.path, item.attribute);\n });\n return false;\n }\n this.path.drawWithClipRange(ctx, size, x, y, clipRange);\n // this.path.drawWithClipRange && this.path.drawWithClipRange(ctx, clipRange);\n // renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset);\n return false;\n }\n\n bounds(size: number, bounds: IBounds) {\n size = this.parseSize(size);\n if (this.isSvg) {\n if (!this.svgCache) {\n return;\n }\n bounds.clear();\n this.svgCache.forEach(({ path }) => {\n tempBounds.x1 = path.bounds.x1 * size;\n tempBounds.y1 = path.bounds.y1 * size;\n tempBounds.x2 = path.bounds.x2 * size;\n tempBounds.y2 = path.bounds.y2 * size;\n bounds.union(tempBounds);\n });\n return;\n }\n if (!this.path.bounds) {\n return;\n }\n bounds.x1 = this.path.bounds.x1 * size;\n bounds.y1 = this.path.bounds.y1 * size;\n bounds.x2 = this.path.bounds.x2 * size;\n bounds.y2 = this.path.bounds.y2 * size;\n }\n}\n\n// export function CustomSymbol(): ISymbolClass {\n\n// }\n"]}
1
+ {"version":3,"sources":["../src/graphic/builtin-symbol/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAgB,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAGrE,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;AACpC,MAAM,OAAO,iBAAiB;IAO5B,YACE,IAAY,EACZ,IAAsF,EACtF,QAAiB,KAAK;QAPxB,YAAO,GAAW,EAAE,CAAC;QASnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE;YACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;SACtB;aAAM;YACL,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;SAClB;QACD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,UAAU,CACR,GAAe,EACf,IAAY,EACZ,CAAS,EACT,CAAS,EACT,MAAc,EACd,CAAU,EACV,EAAmE;QAEnE,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC5B,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAClB,OAAO,KAAK,CAAC;aACd;YACD,IAAI,CA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,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACrB,OAAO;SACR;QACD,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;IACzC,CAAC;CACF","file":"utils.js","sourcesContent":["import { isArray, type IBounds, AABBBounds, isNumber } from '@visactor/vutils';\nimport { renderCommandList } from '../../common/render-command-list';\nimport type { IContext2d, ICustomPath2D, IGraphicAttribute, IPath2D, ISymbolClass } from '../../interface';\n\nconst tempBounds = new AABBBounds();\nexport class CustomSymbolClass implements ISymbolClass {\n type: string;\n path: ICustomPath2D;\n pathStr: string = '';\n isSvg: boolean;\n svgCache?: { path: ICustomPath2D; attribute: Partial<IGraphicAttribute> }[];\n\n constructor(\n type: string,\n path: ICustomPath2D | { path: ICustomPath2D; attribute: Partial<IGraphicAttribute> }[],\n isSvg: boolean = false\n ) {\n this.type = type;\n if (isArray(path)) {\n this.svgCache = path;\n } else {\n this.path = path;\n }\n this.isSvg = isSvg;\n }\n\n drawOffset(\n ctx: IContext2d,\n size: number,\n x: number,\n y: number,\n offset: number,\n z?: number,\n cb?: (path: ICustomPath2D, attribute?: Record<string, any>) => void\n ) {\n size = this.parseSize(size);\n if (this.isSvg) {\n if (!this.svgCache) {\n return false;\n }\n this.svgCache.forEach(item => {\n ctx.beginPath();\n renderCommandList(item.path.commandList, ctx, x, y, size, size);\n cb && cb(item.path, item.attribute);\n });\n return false;\n }\n renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset);\n return false;\n }\n\n draw(\n ctx: IContext2d,\n size: number,\n x: number,\n y: number,\n z?: number,\n cb?: (path: ICustomPath2D, attribute?: Record<string, any>) => void\n ) {\n size = this.parseSize(size);\n return this.drawOffset(ctx, size, x, y, 0, z, cb);\n }\n\n protected parseSize(size: number | [number, number]): number {\n return isNumber(size) ? size : Math.min(size[0], size[1]);\n }\n drawWithClipRange(\n ctx: IPath2D,\n size: number,\n x: number,\n y: number,\n clipRange: number,\n z?: number,\n cb?: (p: ICustomPath2D, a: any) => void\n ) {\n size = this.parseSize(size);\n if (this.isSvg) {\n if (!this.svgCache) {\n return false;\n }\n this.svgCache.forEach(item => {\n item.path.drawWithClipRange(ctx, size, x, y, clipRange);\n cb && cb(item.path, item.attribute);\n });\n return false;\n }\n this.path.drawWithClipRange(ctx, size, x, y, clipRange);\n // this.path.drawWithClipRange && this.path.drawWithClipRange(ctx, clipRange);\n // renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset);\n return false;\n }\n\n bounds(size: number, bounds: IBounds) {\n size = this.parseSize(size);\n if (this.isSvg) {\n if (!this.svgCache) {\n return;\n }\n bounds.clear();\n this.svgCache.forEach(({ path }) => {\n tempBounds.x1 = path.bounds.x1 * size;\n tempBounds.y1 = path.bounds.y1 * size;\n tempBounds.x2 = path.bounds.x2 * size;\n tempBounds.y2 = path.bounds.y2 * size;\n bounds.union(tempBounds);\n });\n return;\n }\n if (!this.path.bounds) {\n return;\n }\n bounds.x1 = this.path.bounds.x1 * size;\n bounds.y1 = this.path.bounds.y1 * size;\n bounds.x2 = this.path.bounds.x2 * size;\n bounds.y2 = this.path.bounds.y2 * size;\n }\n}\n\n// export function CustomSymbol(): ISymbolClass {\n\n// }\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vrender-core",
3
- "version": "0.22.0-vstory.5",
3
+ "version": "0.22.0-vstory.6",
4
4
  "description": "",
5
5
  "sideEffects": [
6
6
  "./src/modules.ts",
@@ -36,8 +36,8 @@
36
36
  "typescript": "4.9.5",
37
37
  "cross-env": "^7.0.3",
38
38
  "@internal/bundler": "0.0.1",
39
- "@internal/eslint-config": "0.0.1",
40
- "@internal/ts-config": "0.0.1"
39
+ "@internal/ts-config": "0.0.1",
40
+ "@internal/eslint-config": "0.0.1"
41
41
  },
42
42
  "keywords": [
43
43
  "VisActor",