mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-02-24 10:54:50 +00:00
Code cleaned up
This commit is contained in:
parent
f29c705bba
commit
5558e17aaf
@ -38,9 +38,8 @@ export class MovingModeComponent implements OnInit, OnDestroy {
|
|||||||
this.mousemoveListener = (event: MouseEvent) => {
|
this.mousemoveListener = (event: MouseEvent) => {
|
||||||
const view = select(this.svg);
|
const view = select(this.svg);
|
||||||
const canvas = view.selectAll<SVGGElement, Context>('g.canvas').data([this.context]);
|
const canvas = view.selectAll<SVGGElement, Context>('g.canvas').data([this.context]);
|
||||||
const canvasEnter = canvas.enter().append<SVGGElement>('g').attr('class', 'canvas');
|
|
||||||
|
|
||||||
canvas.merge(canvasEnter).attr('transform', () => {
|
canvas.attr('transform', () => {
|
||||||
this.context.transformation.x = this.context.transformation.x + event.movementX;
|
this.context.transformation.x = this.context.transformation.x + event.movementX;
|
||||||
this.context.transformation.y = this.context.transformation.y + event.movementY;
|
this.context.transformation.y = this.context.transformation.y + event.movementY;
|
||||||
|
|
||||||
@ -72,9 +71,8 @@ export class MovingModeComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
const view = select(this.svg);
|
const view = select(this.svg);
|
||||||
const canvas = view.selectAll<SVGGElement, Context>('g.canvas').data([this.context]);
|
const canvas = view.selectAll<SVGGElement, Context>('g.canvas').data([this.context]);
|
||||||
const canvasEnter = canvas.enter().append<SVGGElement>('g').attr('class', 'canvas');
|
|
||||||
|
|
||||||
canvas.merge(canvasEnter).attr('transform', () => {
|
canvas.attr('transform', () => {
|
||||||
this.context.transformation.k = this.context.transformation.k - zoom/10;
|
this.context.transformation.k = this.context.transformation.k - zoom/10;
|
||||||
|
|
||||||
const xTrans = this.context.getZeroZeroTransformationPoint().x + this.context.transformation.x;
|
const xTrans = this.context.getZeroZeroTransformationPoint().x + this.context.transformation.x;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user