Ping dots fly between chassis centres instead of along the cable, and a dragged device leaves its cables behind #1228
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1228
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
Press Ping between two devices and a dot is animated for every frame the simulator reports. The dot
does not travel along the cable. It leaves the centre of the source chassis and arrives at the
centre of the destination, cutting across whatever happens to be in between, while the cable itself
is drawn socket-to-socket somewhere else.
Steps to reproduce
ether1→eth0with 1000BASE-T.while the cable is still drawn where the box used to be — so it follows neither.
Why
web/canvas.js:deviceCenter(id)returnslayout[id] + size/2— the middle of the chassis.animateEvents()tweensdeviceCenter(from)→deviceCenter(to).The frame events already carry the ports (
engine/simulator.jsemits{ type: 'frame', from, fromIface, to, toIface, frame }), and the canvas already knows where everysocket is in world coordinates (
portWorld(deviceId, iface), built bycomputeGeo()duringrender).The animation simply does not use either.
Two related defects in the same area:
pointermovehandler translates the device<g>live, andpointerupcallson.move(...), which persists the layout — but nothing callsrender(). Thecables (and the
portPostable the animation and hit-testing read) keep the pre-drag coordinatesuntil some unrelated event triggers a redraw.
deviceCenter()invents a position for a device with nolayoutentry:{ x: 100, y: 100 }. Thatis a real point in world coordinates, so the dot flies to the top-left corner of the grid rather than
failing visibly.
Expected
is a straight line between those two points.
and a ping that follows the drag uses the new positions.
Not the same as
#66 (cable hit band over sockets) and #61 (ghost link stealing clicks) — those are hit-testing; this is
the animation path and the redraw after a move.