mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
The renderer seam: clicks go to the newest tool, recession and display groups through the contract, drawing at parity with Cesium
- Clicks: when two tools want the globe's clicks, the newest takes them and the older is told and turns itself off; a click is decided when it arrives, and ambient selection fires only when no tool holds the pointer. The "map is busy" paths and their strings are removed. - Recession: the limb fade is shared (src/render/recession.js) and reaches icon and model sets through SetSpec.recede; tuning applies on the next frame. - Display panel groups are published through src/ui/displayGroups.js; the Weather group and src/viewWeather.js are removed. - Draw port: a set whose icons only move is moved in place, and models that did not change are not restyled each frame, so moving fleets cost what they did when drawn directly; an untinted, fully opaque model is drawn without a colour. - Conformance: input.lease.lost checks the new lease inside onLost and reports a throwing onLost; draw.sets.recede covers model sets. - QA scripts read the renderer host instead of internals the seam replaced.
This commit is contained in:
1 parent
a0d299523d
commit
0ab31d4fb8
130 files changed
+5438
-1674
No files matched your search
@@ -160,17 +160,36 @@ test('an Escape interceptor that claims the key leaves the tool armed; the next
|
||||
await f.tool.destroy();
|
||||
});
|
||||
|
||||
test('a held pointer refuses the session and nothing is borrowed', async () => {
|
||||
test('a session takes the pointer from another tool, which is told', async () => {
|
||||
const f = fixture();
|
||||
let lost = 0;
|
||||
claimPointer('draw', { onLost: () => (lost += 1) });
|
||||
assert.equal(f.tool.start(), true);
|
||||
assert.equal(pointerOwner(), IMAGERY_BOX_POINTER_OWNER);
|
||||
assert.equal(lost, 1);
|
||||
assert.deepEqual(f.cancels, []);
|
||||
await f.tool.destroy();
|
||||
});
|
||||
|
||||
test('a newer tool taking the pointer mid-drag cancels the session and returns everything', async () => {
|
||||
const f = fixture();
|
||||
f.tool.start();
|
||||
f.fire('LEFT_DOWN', { position: { x: 250, y: 125 } });
|
||||
f.fire('MOUSE_MOVE', { endPosition: { x: 500, y: 250 } });
|
||||
assert.equal(f.camera.enableInputs, false);
|
||||
const lease = claimPointer('draw');
|
||||
assert.equal(f.tool.start(), false);
|
||||
assert.deepEqual(f.cancels, [
|
||||
['pointer-busy', 'draw is using the pointer — close it first'],
|
||||
]);
|
||||
assert.equal(f.tool.isActive(), false);
|
||||
assert.deepEqual(f.cancels, [['cancel', undefined]], 'as if cancelled');
|
||||
assert.deepEqual(f.actives, [true, false]);
|
||||
assert.equal(f.camera.enableInputs, true, 'the camera is back');
|
||||
assert.equal(f.preview(), false, 'no box is left on the globe');
|
||||
assert.equal(f.stockAction('LEFT_CLICK'), f.originalClick);
|
||||
assert.equal(f.bound(), false);
|
||||
assert.equal(f.documentRef.classes.has('gev-imagery-box'), false);
|
||||
assert.equal(pointerOwner(), 'draw', 'the newer tool keeps it');
|
||||
f.fire('LEFT_UP', { position: { x: 500, y: 250 } });
|
||||
assert.deepEqual(f.boxes, [], 'the drag it ended hands over no box');
|
||||
releasePointer(lease);
|
||||
assert.equal(f.tool.start(), true);
|
||||
await f.tool.destroy();
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user