diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 7b410c21a..b69038d6a 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -14,7 +14,7 @@ importers: '@types/react-dom': ^18.0.0 '@visactor/vchart': 1.3.0 '@visactor/vgrammar': ~0.5.7 - '@visactor/vrender': workspace:0.21.4 + '@visactor/vrender': workspace:0.21.5 '@visactor/vutils': ~0.19.2 '@vitejs/plugin-react': 3.1.0 axios: ^1.4.0 @@ -71,7 +71,7 @@ importers: '@types/react': ^18.0.0 '@types/react-dom': ^18.0.0 '@types/react-reconciler': ^0.28.2 - '@visactor/vrender': workspace:0.21.4 + '@visactor/vrender': workspace:0.21.5 '@visactor/vutils': ~0.19.2 '@vitejs/plugin-react': 3.1.0 cross-env: ^7.0.3 @@ -111,8 +111,8 @@ importers: '@rushstack/eslint-patch': ~1.1.4 '@types/react': ^18.0.0 '@types/react-dom': ^18.0.0 - '@visactor/react-vrender': workspace:0.21.4 - '@visactor/vrender': workspace:0.21.4 + '@visactor/react-vrender': workspace:0.21.5 + '@visactor/vrender': workspace:0.21.5 '@visactor/vutils': ~0.19.2 '@vitejs/plugin-react': 3.1.0 cross-env: ^7.0.3 @@ -153,8 +153,8 @@ importers: '@types/jest': ^26.0.0 '@types/react': ^18.0.0 '@types/react-dom': ^18.0.0 - '@visactor/vrender-core': workspace:0.21.4 - '@visactor/vrender-kits': workspace:0.21.4 + '@visactor/vrender-core': workspace:0.21.5 + '@visactor/vrender-kits': workspace:0.21.5 '@visactor/vutils': ~0.19.2 '@vitejs/plugin-react': 3.1.0 canvas: 2.11.2 @@ -200,8 +200,8 @@ importers: '@internal/ts-config': workspace:* '@rushstack/eslint-patch': ~1.1.4 '@types/jest': ^26.0.0 - '@visactor/vrender-core': workspace:0.21.4 - '@visactor/vrender-kits': workspace:0.21.4 + '@visactor/vrender-core': workspace:0.21.5 + '@visactor/vrender-kits': workspace:0.21.5 '@visactor/vscale': ~0.19.2 '@visactor/vutils': ~0.19.2 cross-env: ^7.0.3 @@ -287,7 +287,7 @@ importers: '@types/node-fetch': 2.6.4 '@types/react': ^18.0.0 '@types/react-dom': ^18.0.0 - '@visactor/vrender-core': workspace:0.21.4 + '@visactor/vrender-core': workspace:0.21.5 '@visactor/vutils': ~0.19.2 '@vitejs/plugin-react': 3.1.0 canvas: 2.11.2 @@ -369,10 +369,10 @@ importers: '@rushstack/eslint-patch': ~1.1.4 '@types/node': '*' '@types/node-fetch': 2.6.4 - '@visactor/vrender': workspace:0.21.4 - '@visactor/vrender-components': workspace:0.21.4 - '@visactor/vrender-core': workspace:0.21.4 - '@visactor/vrender-kits': workspace:0.21.4 + '@visactor/vrender': workspace:0.21.5 + '@visactor/vrender-components': workspace:0.21.5 + '@visactor/vrender-core': workspace:0.21.5 + '@visactor/vrender-kits': workspace:0.21.5 cross-env: ^7.0.3 eslint: ~8.18.0 form-data: ~4.0.0 diff --git a/common/config/rush/version-policies.json b/common/config/rush/version-policies.json index 7f88b0965..88114a5db 100644 --- a/common/config/rush/version-policies.json +++ b/common/config/rush/version-policies.json @@ -1 +1 @@ -[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"0.21.4","nextBump":"patch"}] +[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"0.21.5","nextBump":"patch"}] diff --git a/docs/assets/changelog/en/changelog.md b/docs/assets/changelog/en/changelog.md index 09fb203e4..553a897db 100644 --- a/docs/assets/changelog/en/changelog.md +++ b/docs/assets/changelog/en/changelog.md @@ -1,3 +1,16 @@ +# v0.21.4 + +2024-12-23 + + +**🐛 Bug fix** + +- **@visactor/vrender-kits**: fix issue with gesture emitEvent when gesture is released + + + +[more detail about v0.21.4](https://github.com/VisActor/VRender/releases/tag/v0.21.4) + # v0.21.3 2024-12-23 diff --git a/docs/assets/changelog/zh/changelog.md b/docs/assets/changelog/zh/changelog.md index c1cac48e1..737084441 100644 --- a/docs/assets/changelog/zh/changelog.md +++ b/docs/assets/changelog/zh/changelog.md @@ -1,3 +1,16 @@ +# v0.21.4 + +2024-12-23 + + +**🐛 功能修复** + +- **@visactor/vrender-kits**: fix issue with gesture emitEvent when gesture is released + + + +[更多详情请查看 v0.21.4](https://github.com/VisActor/VRender/releases/tag/v0.21.4) + # v0.21.3 2024-12-23 diff --git a/docs/package.json b/docs/package.json index 572beefc9..4f83bec33 100644 --- a/docs/package.json +++ b/docs/package.json @@ -13,7 +13,7 @@ "@visactor/vchart": "1.3.0", "@visactor/vutils": "~0.19.2", "@visactor/vgrammar": "~0.5.7", - "@visactor/vrender": "workspace:0.21.4", + "@visactor/vrender": "workspace:0.21.5", "markdown-it": "^13.0.0", "highlight.js": "^11.8.0", "axios": "^1.4.0", diff --git a/packages/react-vrender-utils/CHANGELOG.json b/packages/react-vrender-utils/CHANGELOG.json index 076146ca6..93133638b 100644 --- a/packages/react-vrender-utils/CHANGELOG.json +++ b/packages/react-vrender-utils/CHANGELOG.json @@ -1,6 +1,12 @@ { "name": "@visactor/react-vrender-utils", "entries": [ + { + "version": "0.21.5", + "tag": "@visactor/react-vrender-utils_v0.21.5", + "date": "Tue, 24 Dec 2024 07:53:11 GMT", + "comments": {} + }, { "version": "0.21.4", "tag": "@visactor/react-vrender-utils_v0.21.4", diff --git a/packages/react-vrender-utils/CHANGELOG.md b/packages/react-vrender-utils/CHANGELOG.md index 7578c992b..4d04e29eb 100644 --- a/packages/react-vrender-utils/CHANGELOG.md +++ b/packages/react-vrender-utils/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @visactor/react-vrender-utils -This log was last generated on Mon, 23 Dec 2024 10:16:00 GMT and should not be manually modified. +This log was last generated on Tue, 24 Dec 2024 07:53:11 GMT and should not be manually modified. + +## 0.21.5 +Tue, 24 Dec 2024 07:53:11 GMT + +_Version update only_ ## 0.21.4 Mon, 23 Dec 2024 10:16:00 GMT diff --git a/packages/react-vrender-utils/package.json b/packages/react-vrender-utils/package.json index f100bebaa..0b9e18757 100644 --- a/packages/react-vrender-utils/package.json +++ b/packages/react-vrender-utils/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/react-vrender-utils", - "version": "0.21.4", + "version": "0.21.5", "description": "", "sideEffects": false, "main": "cjs/index.js", @@ -24,8 +24,8 @@ "react-dom": "^18.2.0" }, "dependencies": { - "@visactor/vrender": "workspace:0.21.4", - "@visactor/react-vrender": "workspace:0.21.4", + "@visactor/vrender": "workspace:0.21.5", + "@visactor/react-vrender": "workspace:0.21.5", "@visactor/vutils": "~0.19.2", "react-reconciler": "^0.29.0", "tslib": "^2.3.1" diff --git a/packages/react-vrender/CHANGELOG.json b/packages/react-vrender/CHANGELOG.json index 433e8a9c7..ee59616da 100644 --- a/packages/react-vrender/CHANGELOG.json +++ b/packages/react-vrender/CHANGELOG.json @@ -1,6 +1,12 @@ { "name": "@visactor/react-vrender", "entries": [ + { + "version": "0.21.5", + "tag": "@visactor/react-vrender_v0.21.5", + "date": "Tue, 24 Dec 2024 07:53:11 GMT", + "comments": {} + }, { "version": "0.21.4", "tag": "@visactor/react-vrender_v0.21.4", diff --git a/packages/react-vrender/CHANGELOG.md b/packages/react-vrender/CHANGELOG.md index 593557f50..dd3eff19f 100644 --- a/packages/react-vrender/CHANGELOG.md +++ b/packages/react-vrender/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @visactor/react-vrender -This log was last generated on Mon, 23 Dec 2024 10:16:00 GMT and should not be manually modified. +This log was last generated on Tue, 24 Dec 2024 07:53:11 GMT and should not be manually modified. + +## 0.21.5 +Tue, 24 Dec 2024 07:53:11 GMT + +_Version update only_ ## 0.21.4 Mon, 23 Dec 2024 10:16:00 GMT diff --git a/packages/react-vrender/package.json b/packages/react-vrender/package.json index cb9a23a50..6a6b46280 100644 --- a/packages/react-vrender/package.json +++ b/packages/react-vrender/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/react-vrender", - "version": "0.21.4", + "version": "0.21.5", "description": "", "sideEffects": false, "main": "cjs/index.js", @@ -23,7 +23,7 @@ "react": "^18.2.0" }, "dependencies": { - "@visactor/vrender": "workspace:0.21.4", + "@visactor/vrender": "workspace:0.21.5", "@visactor/vutils": "~0.19.2", "react-reconciler": "^0.29.0", "tslib": "^2.3.1" diff --git a/packages/vrender-components/CHANGELOG.json b/packages/vrender-components/CHANGELOG.json index 7047f6127..5cb287cd7 100644 --- a/packages/vrender-components/CHANGELOG.json +++ b/packages/vrender-components/CHANGELOG.json @@ -1,6 +1,12 @@ { "name": "@visactor/vrender-components", "entries": [ + { + "version": "0.21.5", + "tag": "@visactor/vrender-components_v0.21.5", + "date": "Tue, 24 Dec 2024 07:53:11 GMT", + "comments": {} + }, { "version": "0.21.4", "tag": "@visactor/vrender-components_v0.21.4", diff --git a/packages/vrender-components/CHANGELOG.md b/packages/vrender-components/CHANGELOG.md index ba9de1304..d80d802d4 100644 --- a/packages/vrender-components/CHANGELOG.md +++ b/packages/vrender-components/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @visactor/vrender-components -This log was last generated on Mon, 23 Dec 2024 10:16:00 GMT and should not be manually modified. +This log was last generated on Tue, 24 Dec 2024 07:53:11 GMT and should not be manually modified. + +## 0.21.5 +Tue, 24 Dec 2024 07:53:11 GMT + +_Version update only_ ## 0.21.4 Mon, 23 Dec 2024 10:16:00 GMT diff --git a/packages/vrender-components/package.json b/packages/vrender-components/package.json index 1934f1e18..af0c95fa6 100644 --- a/packages/vrender-components/package.json +++ b/packages/vrender-components/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vrender-components", - "version": "0.21.4", + "version": "0.21.5", "description": "components library for dp visualization", "sideEffects": false, "main": "cjs/index.js", @@ -27,8 +27,8 @@ "dependencies": { "@visactor/vutils": "~0.19.2", "@visactor/vscale": "~0.19.2", - "@visactor/vrender-core": "workspace:0.21.4", - "@visactor/vrender-kits": "workspace:0.21.4" + "@visactor/vrender-core": "workspace:0.21.5", + "@visactor/vrender-kits": "workspace:0.21.5" }, "devDependencies": { "@internal/bundler": "workspace:*", diff --git a/packages/vrender-components/src/axis/base.ts b/packages/vrender-components/src/axis/base.ts index 9fc851f29..963a541ff 100644 --- a/packages/vrender-components/src/axis/base.ts +++ b/packages/vrender-components/src/axis/base.ts @@ -340,7 +340,7 @@ export abstract class AxisBase extends AbstractCom }); text.states = labelState; } - + text.data = { ...item, index, layer }; labelGroup.add(text); }); diff --git a/packages/vrender-core/CHANGELOG.json b/packages/vrender-core/CHANGELOG.json index e02bc7f58..5dec233a8 100644 --- a/packages/vrender-core/CHANGELOG.json +++ b/packages/vrender-core/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@visactor/vrender-core", "entries": [ + { + "version": "0.21.5", + "tag": "@visactor/vrender-core_v0.21.5", + "date": "Tue, 24 Dec 2024 07:53:11 GMT", + "comments": { + "none": [ + { + "comment": "fix: fix issue with image background stroke, closed #1640" + } + ] + } + }, { "version": "0.21.4", "tag": "@visactor/vrender-core_v0.21.4", diff --git a/packages/vrender-core/CHANGELOG.md b/packages/vrender-core/CHANGELOG.md index 7304a989f..1e98bfc1e 100644 --- a/packages/vrender-core/CHANGELOG.md +++ b/packages/vrender-core/CHANGELOG.md @@ -1,6 +1,13 @@ # Change Log - @visactor/vrender-core -This log was last generated on Mon, 23 Dec 2024 10:16:00 GMT and should not be manually modified. +This log was last generated on Tue, 24 Dec 2024 07:53:11 GMT and should not be manually modified. + +## 0.21.5 +Tue, 24 Dec 2024 07:53:11 GMT + +### Updates + +- fix: fix issue with image background stroke, closed #1640 ## 0.21.4 Mon, 23 Dec 2024 10:16:00 GMT diff --git a/packages/vrender-core/package.json b/packages/vrender-core/package.json index 087eb08b0..cc081151d 100644 --- a/packages/vrender-core/package.json +++ b/packages/vrender-core/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vrender-core", - "version": "0.21.4", + "version": "0.21.5", "description": "", "sideEffects": [ "./src/modules.ts", diff --git a/packages/vrender-core/src/render/contributions/render/contributions/image-contribution-render.ts b/packages/vrender-core/src/render/contributions/render/contributions/image-contribution-render.ts index bb0e833de..37a95be2d 100644 --- a/packages/vrender-core/src/render/contributions/render/contributions/image-contribution-render.ts +++ b/packages/vrender-core/src/render/contributions/render/contributions/image-contribution-render.ts @@ -10,137 +10,140 @@ import type { IMarkAttribute } from '../../../../interface'; import { getTheme } from '../../../../graphic/theme'; -import { DefaultBaseBackgroundRenderContribution } from './base-contribution-render'; +import { + defaultBaseBackgroundRenderContribution, + DefaultBaseBackgroundRenderContribution +} from './base-contribution-render'; import { BaseRenderContributionTime } from '../../../../common/enums'; import { isNumber, isObject } from '@visactor/vutils'; import { parsePadding } from '../../../../common/utils'; import { createRectPath } from '../../../../common/shape/rect'; import { DefaultRectRenderContribution } from './rect-contribution-render'; -export class DefaultImageBackgroundRenderContribution - extends DefaultBaseBackgroundRenderContribution - implements IImageRenderContribution -{ - time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke; +// export class DefaultImageBackgroundRenderContribution +// extends DefaultBaseBackgroundRenderContribution +// implements IImageRenderContribution +// { +// time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke; - drawShape( - graphic: IImage, - context: IContext2d, - x: number, - y: number, - doFill: boolean, - doStroke: boolean, - fVisible: boolean, - sVisible: boolean, - graphicAttribute: Required, - drawContext: IDrawContext, - fillCb?: (ctx: IContext2d, markAttribute: Partial, themeAttribute: IThemeAttribute) => boolean, - strokeCb?: (ctx: IContext2d, markAttribute: Partial, themeAttribute: IThemeAttribute) => boolean - ) { - const { - background, - backgroundMode = graphicAttribute.backgroundMode, - backgroundFit = graphicAttribute.backgroundFit, - width, - height - } = graphic.attribute; - if (!background) { - return; - } +// drawShape( +// graphic: IImage, +// context: IContext2d, +// x: number, +// y: number, +// doFill: boolean, +// doStroke: boolean, +// fVisible: boolean, +// sVisible: boolean, +// graphicAttribute: Required, +// drawContext: IDrawContext, +// fillCb?: (ctx: IContext2d, markAttribute: Partial, themeAttribute: IThemeAttribute) => boolean, +// strokeCb?: (ctx: IContext2d, markAttribute: Partial, themeAttribute: IThemeAttribute) => boolean +// ) { +// const { +// background, +// backgroundMode = graphicAttribute.backgroundMode, +// backgroundFit = graphicAttribute.backgroundFit, +// width, +// height +// } = graphic.attribute; +// if (!background) { +// return; +// } - if (!graphic.backgroundImg) { - if (isObject(background)) { - const { - stroke, - fill, - lineWidth = 1, - cornerRadius = 0, - expandX = 0, - expandY = 0 - } = background as IBackgroundConfig; +// if (!graphic.backgroundImg) { +// if (isObject(background)) { +// const { +// stroke, +// fill, +// lineWidth = 1, +// cornerRadius = 0, +// expandX = 0, +// expandY = 0 +// } = background as IBackgroundConfig; - if (!stroke && !fill) { - return; - } +// if (!stroke && !fill) { +// return; +// } - context.beginPath(); - const { x, y, width, height } = getActualPosition(graphic); - if (cornerRadius) { - createRectPath(context, x - expandX, y - expandY, width + expandX * 2, height + expandY * 2, cornerRadius); - } else { - context.rect(x - expandX, y - expandY, width + expandX * 2, height + expandY * 2); - } +// context.beginPath(); +// const { x, y, width, height } = getActualPosition(graphic); +// if (cornerRadius) { +// createRectPath(context, x - expandX, y - expandY, width + expandX * 2, height + expandY * 2, cornerRadius); +// } else { +// context.rect(x - expandX, y - expandY, width + expandX * 2, height + expandY * 2); +// } - context.globalAlpha = 1; - if (fill) { - context.fillStyle = fill as string; - context.fill(); - } +// context.globalAlpha = 1; +// if (fill) { +// context.fillStyle = fill as string; +// context.fill(); +// } - if (stroke && lineWidth > 0) { - context.lineWidth = lineWidth; - context.strokeStyle = stroke as string; - context.stroke(); - } - } else { - context.beginPath(); - // const b = graphic.AABBBounds; - // image的背景不包括Bounds了 - context.rect(x, y, width || 0, height || 0); - context.fillStyle = background as string; - context.globalAlpha = 1; - context.fill(); - } - } else { - const res = graphic.resources.get(background as any); - if (res.state !== 'success' || !res.data) { - return; - } - context.save(); - if (graphic.parent && !graphic.transMatrix.onlyTranslate()) { - const groupAttribute = getTheme(graphic.parent).group; - const { scrollX = groupAttribute.scrollX, scrollY = groupAttribute.scrollY } = graphic.parent.attribute; - context.setTransformFromMatrix(graphic.parent.globalTransMatrix, true); - context.translate(scrollX, scrollY); - } - // context.clip(); - const b = graphic.AABBBounds; - this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit); - context.restore(); - if (!graphic.transMatrix.onlyTranslate()) { - context.setTransformForCurrent(); - } - } - } -} +// if (stroke && lineWidth > 0) { +// context.lineWidth = lineWidth; +// context.strokeStyle = stroke as string; +// context.stroke(); +// } +// } else { +// context.beginPath(); +// // const b = graphic.AABBBounds; +// // image的背景不包括Bounds了 +// context.rect(x, y, width || 0, height || 0); +// context.fillStyle = background as string; +// context.globalAlpha = 1; +// context.fill(); +// } +// } else { +// const res = graphic.resources.get(background as any); +// if (res.state !== 'success' || !res.data) { +// return; +// } +// context.save(); +// if (graphic.parent && !graphic.transMatrix.onlyTranslate()) { +// const groupAttribute = getTheme(graphic.parent).group; +// const { scrollX = groupAttribute.scrollX, scrollY = groupAttribute.scrollY } = graphic.parent.attribute; +// context.setTransformFromMatrix(graphic.parent.globalTransMatrix, true); +// context.translate(scrollX, scrollY); +// } +// // context.clip(); +// const b = graphic.AABBBounds; +// this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit); +// context.restore(); +// if (!graphic.transMatrix.onlyTranslate()) { +// context.setTransformForCurrent(); +// } +// } +// } +// } -function getActualPosition(graphic: IGraphic) { - const boundsPadding = parsePadding(graphic.attribute.boundsPadding); - const bounds = graphic.AABBBounds; - let x = bounds.x1; - let y = bounds.y1; - let width = bounds.width(); - let height = bounds.height(); +// function getActualPosition(graphic: IGraphic) { +// const boundsPadding = parsePadding(graphic.attribute.boundsPadding); +// const bounds = graphic.AABBBounds; +// let x = bounds.x1; +// let y = bounds.y1; +// let width = bounds.width(); +// let height = bounds.height(); - if (isNumber(boundsPadding)) { - x += boundsPadding; - y += boundsPadding; - width -= boundsPadding * 2; - height -= boundsPadding * 2; - } else { - x += boundsPadding[3]; - y += boundsPadding[0]; - width -= boundsPadding[1] + boundsPadding[3]; - height -= boundsPadding[0] + boundsPadding[2]; - } +// if (isNumber(boundsPadding)) { +// x += boundsPadding; +// y += boundsPadding; +// width -= boundsPadding * 2; +// height -= boundsPadding * 2; +// } else { +// x += boundsPadding[3]; +// y += boundsPadding[0]; +// width -= boundsPadding[1] + boundsPadding[3]; +// height -= boundsPadding[0] + boundsPadding[2]; +// } - return { - x, - y, - width, - height - }; -} +// return { +// x, +// y, +// width, +// height +// }; +// } export class DefaultImageRenderContribution extends DefaultRectRenderContribution implements IImageRenderContribution { time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke; @@ -186,4 +189,4 @@ export class DefaultImageRenderContribution extends DefaultRectRenderContributio } export const defaultImageRenderContribution = new DefaultImageRenderContribution(); -export const defaultImageBackgroundRenderContribution = new DefaultImageBackgroundRenderContribution(); +export const defaultImageBackgroundRenderContribution = defaultBaseBackgroundRenderContribution; diff --git a/packages/vrender-core/src/render/contributions/render/image-render.ts b/packages/vrender-core/src/render/contributions/render/image-render.ts index 540b09a07..7155d0cbf 100644 --- a/packages/vrender-core/src/render/contributions/render/image-render.ts +++ b/packages/vrender-core/src/render/contributions/render/image-render.ts @@ -80,11 +80,30 @@ export class DefaultCanvasImageRender extends BaseRender implements IGra } const { fVisible, sVisible, doFill, doStroke } = data; - // shadow - context.setShadowBlendStyle && context.setShadowBlendStyle(image, image.attribute, imageAttribute); + if (!url || !image.resources) { + return; + } + const res = image.resources.get(url); + if (res.state !== 'success') { + return; + } + + // deal with cornerRadius + let needRestore = false; + if (cornerRadius === 0 || (isArray(cornerRadius) && (cornerRadius).every(num => num === 0))) { + // 不需要处理圆角 + } else { + context.beginPath(); + createRectPath(context, x, y, width, height, cornerRadius); + context.save(); + context.clip(); + needRestore = true; + } this.beforeRenderStep(image, context, x, y, doFill, false, fVisible, false, imageAttribute, drawContext, fillCb); + // shadow + context.setShadowBlendStyle && context.setShadowBlendStyle(image, image.attribute, imageAttribute); // context.beginPath(); // context.image(x, y, width, height); @@ -93,26 +112,6 @@ export class DefaultCanvasImageRender extends BaseRender implements IGra if (fillCb) { fillCb(context, image.attribute, imageAttribute); } else if (fVisible) { - if (!url || !image.resources) { - return; - } - const res = image.resources.get(url); - if (res.state !== 'success') { - return; - } - - // deal with cornerRadius - let needRestore = false; - if (cornerRadius === 0 || (isArray(cornerRadius) && (cornerRadius).every(num => num === 0))) { - // 不需要处理圆角 - } else { - context.beginPath(); - createRectPath(context, x, y, width, height, cornerRadius); - context.save(); - context.clip(); - needRestore = true; - } - context.setCommonStyle(image, image.attribute, x, y, imageAttribute); let repeat = 0; if (repeatX === 'repeat') { @@ -130,10 +129,6 @@ export class DefaultCanvasImageRender extends BaseRender implements IGra } else { context.drawImage(res.data, x, y, width, height); } - - if (needRestore) { - context.restore(); - } } } }; @@ -144,7 +139,7 @@ export class DefaultCanvasImageRender extends BaseRender implements IGra strokeCb(context, image.attribute, imageAttribute); } else if (sVisible) { context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute); - context.strokeRect(x, y, width, height); + context.stroke(); } } }; @@ -158,6 +153,10 @@ export class DefaultCanvasImageRender extends BaseRender implements IGra } this.afterRenderStep(image, context, x, y, doFill, false, fVisible, false, imageAttribute, drawContext, fillCb); + + if (needRestore) { + context.restore(); + } } draw(image: IImage, renderService: IRenderService, drawContext: IDrawContext) { diff --git a/packages/vrender-kits/CHANGELOG.json b/packages/vrender-kits/CHANGELOG.json index 8ce7ec4a9..82b69454e 100644 --- a/packages/vrender-kits/CHANGELOG.json +++ b/packages/vrender-kits/CHANGELOG.json @@ -1,6 +1,12 @@ { "name": "@visactor/vrender-kits", "entries": [ + { + "version": "0.21.5", + "tag": "@visactor/vrender-kits_v0.21.5", + "date": "Tue, 24 Dec 2024 07:53:11 GMT", + "comments": {} + }, { "version": "0.21.4", "tag": "@visactor/vrender-kits_v0.21.4", diff --git a/packages/vrender-kits/CHANGELOG.md b/packages/vrender-kits/CHANGELOG.md index ea5e8af78..162c3e485 100644 --- a/packages/vrender-kits/CHANGELOG.md +++ b/packages/vrender-kits/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @visactor/vrender-kits -This log was last generated on Mon, 23 Dec 2024 10:16:00 GMT and should not be manually modified. +This log was last generated on Tue, 24 Dec 2024 07:53:11 GMT and should not be manually modified. + +## 0.21.5 +Tue, 24 Dec 2024 07:53:11 GMT + +_Version update only_ ## 0.21.4 Mon, 23 Dec 2024 10:16:00 GMT diff --git a/packages/vrender-kits/package.json b/packages/vrender-kits/package.json index eba43ba6d..5a05f137c 100644 --- a/packages/vrender-kits/package.json +++ b/packages/vrender-kits/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vrender-kits", - "version": "0.21.4", + "version": "0.21.5", "description": "", "sideEffects": false, "main": "cjs/index.js", @@ -21,7 +21,7 @@ }, "dependencies": { "@visactor/vutils": "~0.19.2", - "@visactor/vrender-core": "workspace:0.21.4", + "@visactor/vrender-core": "workspace:0.21.5", "@resvg/resvg-js": "2.4.1", "roughjs": "4.5.2" }, diff --git a/packages/vrender/CHANGELOG.json b/packages/vrender/CHANGELOG.json index 3355ae114..6a166b8fe 100644 --- a/packages/vrender/CHANGELOG.json +++ b/packages/vrender/CHANGELOG.json @@ -1,6 +1,12 @@ { "name": "@visactor/vrender", "entries": [ + { + "version": "0.21.5", + "tag": "@visactor/vrender_v0.21.5", + "date": "Tue, 24 Dec 2024 07:53:11 GMT", + "comments": {} + }, { "version": "0.21.4", "tag": "@visactor/vrender_v0.21.4", diff --git a/packages/vrender/CHANGELOG.md b/packages/vrender/CHANGELOG.md index 23b46f83f..7049f5a53 100644 --- a/packages/vrender/CHANGELOG.md +++ b/packages/vrender/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @visactor/vrender -This log was last generated on Mon, 23 Dec 2024 10:16:00 GMT and should not be manually modified. +This log was last generated on Tue, 24 Dec 2024 07:53:12 GMT and should not be manually modified. + +## 0.21.5 +Tue, 24 Dec 2024 07:53:11 GMT + +_Version update only_ ## 0.21.4 Mon, 23 Dec 2024 10:16:00 GMT diff --git a/packages/vrender/package.json b/packages/vrender/package.json index c6796ff01..3e70dc72c 100644 --- a/packages/vrender/package.json +++ b/packages/vrender/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vrender", - "version": "0.21.4", + "version": "0.21.5", "description": "", "sideEffects": true, "main": "cjs/index.js", @@ -24,8 +24,8 @@ "test-watch": "cross-env DEBUG_MODE=1 jest --watch" }, "dependencies": { - "@visactor/vrender-core": "workspace:0.21.4", - "@visactor/vrender-kits": "workspace:0.21.4" + "@visactor/vrender-core": "workspace:0.21.5", + "@visactor/vrender-kits": "workspace:0.21.5" }, "devDependencies": { "@internal/bundler": "workspace:*", diff --git a/tools/bugserver-trigger/package.json b/tools/bugserver-trigger/package.json index 5e8a3de38..81b2d53de 100644 --- a/tools/bugserver-trigger/package.json +++ b/tools/bugserver-trigger/package.json @@ -8,10 +8,10 @@ "ci": "ts-node --transpileOnly --skipProject ./scripts/trigger-test.ts" }, "dependencies": { - "@visactor/vrender": "workspace:0.21.4", - "@visactor/vrender-core": "workspace:0.21.4", - "@visactor/vrender-kits": "workspace:0.21.4", - "@visactor/vrender-components": "workspace:0.21.4" + "@visactor/vrender": "workspace:0.21.5", + "@visactor/vrender-core": "workspace:0.21.5", + "@visactor/vrender-kits": "workspace:0.21.5", + "@visactor/vrender-components": "workspace:0.21.5" }, "devDependencies": { "@rushstack/eslint-patch": "~1.1.4",