Skip to content

Commit

Permalink
Merge pull request #1751 from VisActor/fix/group-setShadowBlendStyle
Browse files Browse the repository at this point in the history
fix: fix issue with group setShadowBlendStyle not work on background
  • Loading branch information
neuqzxy authored Feb 21, 2025
2 parents 25a97e0 + e519211 commit fbb36b0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-core",
"comment": "fix: fix issue with group setShadowBlendStyle not work on background",
"type": "none"
}
],
"packageName": "@visactor/vrender-core"
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ export class DefaultCanvasGroupRender implements IGraphicRender {
doStroke
};

// shadow
context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute);

this._groupRenderContribitions.forEach(c => {
if (c.time === BaseRenderContributionTime.beforeFillStroke) {
// c.useStyle && context.setCommonStyle(group, group.attribute, x, y, groupAttribute);
Expand All @@ -162,9 +165,6 @@ export class DefaultCanvasGroupRender implements IGraphicRender {
context.clip();
}

// shadow
context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute);

const _runFill = () => {
if ((doFillOrStroke as any).doFill) {
if (fillCb) {
Expand Down
6 changes: 4 additions & 2 deletions packages/vrender/__tests__/browser/src/pages/image-cloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ export const page = () => {
width: 300,
height: 300,
background: visactorIcon,
drawMode: 2
drawMode: 1,
clip: true,
globalCompositeOperation: 'destination-in'
});

for (let i = 0; i < 300; i++) {
for (let i = 0; i < 20; i++) {
const image = createImage({
x: Math.random() * 350 - 25,
y: Math.random() * 350 - 25,
Expand Down

0 comments on commit fbb36b0

Please sign in to comment.