Skip to content

Commit

Permalink
Merge pull request #1520 from VisActor/fix/group-gradient
Browse files Browse the repository at this point in the history
fix: fix group fill gradient #1518
  • Loading branch information
neuqzxy authored Oct 30, 2024
2 parents 108b06e + c170809 commit f425014
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-core",
"comment": "fix: fix group fill gradient #1518",
"type": "none"
}
],
"packageName": "@visactor/vrender-core"
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ export class DefaultCanvasGroupRender implements IGraphicRender {
path = groupAttribute.path,
lineWidth = groupAttribute.lineWidth,
visible = groupAttribute.visible,
fillStrokeOrder = groupAttribute.fillStrokeOrder
fillStrokeOrder = groupAttribute.fillStrokeOrder,

x: originX = groupAttribute.x,
y: originY = groupAttribute.y
} = group.attribute;

// 不绘制或者透明
Expand Down Expand Up @@ -166,7 +169,7 @@ export class DefaultCanvasGroupRender implements IGraphicRender {
if (fillCb) {
fillCb(context, group.attribute, groupAttribute);
} else if (fVisible) {
context.setCommonStyle(group, group.attribute, x, y, groupAttribute);
context.setCommonStyle(group, group.attribute, originX - x, originY - y, groupAttribute);
context.fill();
}
}
Expand All @@ -177,7 +180,7 @@ export class DefaultCanvasGroupRender implements IGraphicRender {
if (strokeCb) {
strokeCb(context, group.attribute, groupAttribute);
} else if (sVisible) {
context.setStrokeStyle(group, group.attribute, x, y, groupAttribute);
context.setStrokeStyle(group, group.attribute, originX - x, originY - y, groupAttribute);
context.stroke();
}
}
Expand Down

0 comments on commit f425014

Please sign in to comment.