GNS3 / gns3-web-ui

WebUI implementation for GNS3
GNU General Public License v3.0
147 stars 52 forks source link

Calculating position of new node when topology zoomed in/zoomed out #1139

Open bpozdena opened 3 years ago

bpozdena commented 3 years ago

When topology is zoomed-out and new nodes are placed in different place then where they were dropped it. This is mostly a problem with large typologies/scenes, where new nodes are randomly dropped off visible screen.

Steps to reproduce: 1)Zoom out the topology by a couple of clicks 2)Drag&Drop a new node into the topology. It will be placed in different place, often off the visible screen.

new-node-location

piotrpekala7 commented 3 years ago

@SairusCZ

I added scaling node positions in https://github.com/GNS3/gns3-web-ui/commit/bb2a9632374c8877ad617024d0f2417ec298ca71. You can check it by downloading web UI repo, build it locally and exchange js files.

We rely on events from the browser, so at the time of scaling, if there is a difference between the event propagated in the browser and the place where we dropped the node, then this difference may increase.

If you have any propositions in this matter, adding nodes is handled is here https://github.com/GNS3/gns3-web-ui/blob/master/src/app/components/project-map/project-map.component.ts#L541

piotrpekala7 commented 3 years ago

@SairusCZ

Do you have any propositions regarding calculation of node positions https://github.com/GNS3/gns3-web-ui/blob/master/src/app/components/project-map/project-map.component.ts#L541 ?

piotrpekala7 commented 3 years ago

@SairusCZ

?

bpozdena commented 3 years ago

I have no proposal/idea.

piotrpekala7 commented 3 years ago

I have to change milestone as we have no idea how to resolve this issue now