fixed incorrect positioning on zoom or graph move (#3129)
Fixes #2972 Co-authored-by: Ivan Hrynevytskyi <ivan.hrynevytskyi@IHRYNEVYTSKYIL.local>
This commit is contained in:
parent
4eaa0f6d13
commit
5a0b9fbe50
|
|
@ -74,7 +74,8 @@ export class FlowchartComponent implements ContainerActivityComponent {
|
|||
// TODO: Figure out how to convert client coordinates to appropriate graph coordinates taking into account transformations.
|
||||
// See https://x6.antv.vision/en/docs/api/graph/coordinate for documentation.
|
||||
//const point = graph.coord.localToClientPoint(x, y);
|
||||
const point: PointLike = {x, y};
|
||||
const pageToLocal = graph.pageToLocal(x, y);
|
||||
const point: PointLike = pageToLocal;
|
||||
|
||||
const sx = point.x;
|
||||
const sy = point.y;
|
||||
|
|
|
|||
|
|
@ -271,8 +271,8 @@ export class WorkflowDefinitionEditor {
|
|||
await this.canvas.addActivity({
|
||||
descriptor: activityDescriptor,
|
||||
id: newName,
|
||||
x: e.offsetX,
|
||||
y: e.offsetY
|
||||
x: e.pageX,
|
||||
y: e.pageY
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue