mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-15 07:42:23 +00:00
fix(cockpit): only a ship's double-click remembers where it began
The first press's picture of the track is there because a click on a selected ship re-centres the camera. It applied to followed aircraft too, widening their double-click hit area to wherever the aircraft was drawn as the gesture began. Aircraft are back to the hit where they are drawn.
This commit is contained in:
1 parent
bbe33b48c7
commit
620a18608e
2 files changed
+29
-1
No files matched your search
@@ -1415,6 +1415,28 @@ test('a fix the feed keeps re-serving goes on ageing into a stale feed', async (
|
||||
assert.match($('#cockpit-aircraft-meta').textContent, /STALE FEED/);
|
||||
});
|
||||
|
||||
test('a followed aircraft keeps its own double-click hit area', async (t) => {
|
||||
const aircraftInfo = {
|
||||
icao24: 'abc123',
|
||||
callsign: 'TEST1',
|
||||
latitude: 54.5,
|
||||
longitude: 10.2,
|
||||
altitudeM: 3000,
|
||||
velocityMps: 200,
|
||||
track: 45,
|
||||
onGround: false,
|
||||
};
|
||||
const { cockpit, viewer, aircraft } = fixture(t, { aircraftInfo });
|
||||
viewer.trackedEntity = aircraft;
|
||||
heightSensitiveProjection(viewer);
|
||||
// Drawn at (400, -2700) as the press begins, at (600, -2700) by the
|
||||
// double-click: a click there is not on the aircraft.
|
||||
cockpit.onScenePointerDown(1000);
|
||||
heightSensitiveProjection(viewer, { x: 600 });
|
||||
assert.equal(cockpit.onSceneDoubleClick({ x: 400, y: -2700 }, 1250), false);
|
||||
assert.equal(cockpit.active, false);
|
||||
});
|
||||
|
||||
test("a double-click's second press keeps the first press's picture of the ship", async (t) => {
|
||||
const { cockpit, viewer, store } = fixture(t);
|
||||
heightSensitiveProjection(viewer);
|
||||
|
||||
Reference in new issue
Block a user