Skip to content

Commit

Permalink
Merge pull request #1313 from VisActor/fix/mark-point-target-size
Browse files Browse the repository at this point in the history
Fix/mark point target size
  • Loading branch information
skie1997 authored Jul 23, 2024
2 parents 6769a97 + 9815854 commit a050cd6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-components",
"comment": "fix: markpoint target size compute error. fix@Visactor/VChart#2766",
"type": "none"
}
],
"packageName": "@visactor/vrender-components"
}
3 changes: 2 additions & 1 deletion packages/vrender-components/src/marker/point.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ export class MarkPoint extends Marker<MarkPointAttrs, MarkPointAnimationType> {
x: position.x,
y: position.y,
visible: targetItem.visible ?? false,
size: targetItem.size,
...targetItem.style
});
this._targetItem.states = merge({}, DEFAULT_STATES, this.attribute.state?.targetItem);
Expand Down Expand Up @@ -444,7 +445,7 @@ export class MarkPoint extends Marker<MarkPointAttrs, MarkPointAnimationType> {
visible: targetItemvisible = false,
size: targetSymbolSize
} = targetSymbol;
const targetSize = targetItemvisible ? targetSymbolSize || (targetSymbolStyle.size ?? 10) : 0;
const targetSize = targetItemvisible ? targetSymbolStyle.size ?? targetSymbolSize ?? 20 : 0;
const targetOffsetAngle = deltaXYToAngle(itemContentOffsetY, itemContentOffsetX);
const newPosition: Point = {
x: position.x + (targetSize / 2 + targetSymbolOffset) * Math.cos(targetOffsetAngle),
Expand Down

0 comments on commit a050cd6

Please sign in to comment.