mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-03-13 15:56:49 +00:00
Fix updating text position when zoomed in/out
This commit is contained in:
parent
f866741011
commit
2a859e6329
@ -32,7 +32,7 @@ export class NodeService {
|
|||||||
.post(
|
.post(
|
||||||
server,
|
server,
|
||||||
`/projects/${project.project_id}/templates/${template.template_id}`,
|
`/projects/${project.project_id}/templates/${template.template_id}`,
|
||||||
{'x': x, 'y': y, 'compute_id': compute_id});
|
{'x': Math.round(x), 'y': Math.round(y), 'compute_id': compute_id});
|
||||||
}
|
}
|
||||||
|
|
||||||
updatePosition(server: Server, node: Node, x: number, y: number): Observable<Node> {
|
updatePosition(server: Server, node: Node, x: number, y: number): Observable<Node> {
|
||||||
@ -50,8 +50,8 @@ export class NodeService {
|
|||||||
'rotation': label.rotation,
|
'rotation': label.rotation,
|
||||||
'style': label.style,
|
'style': label.style,
|
||||||
'text': label.text,
|
'text': label.text,
|
||||||
'x': label.x,
|
'x': Math.round(label.x),
|
||||||
'y': label.y
|
'y': Math.round(label.y)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -59,8 +59,8 @@ export class NodeService {
|
|||||||
update(server: Server, node: Node): Observable<Node> {
|
update(server: Server, node: Node): Observable<Node> {
|
||||||
return this.httpServer
|
return this.httpServer
|
||||||
.put<Node>(server, `/projects/${node.project_id}/nodes/${node.node_id}`, {
|
.put<Node>(server, `/projects/${node.project_id}/nodes/${node.node_id}`, {
|
||||||
'x': node.x,
|
'x': Math.round(node.x),
|
||||||
'y': node.y,
|
'y': Math.round(node.y),
|
||||||
'z': node.z
|
'z': node.z
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user