mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42: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
@@ -94,6 +94,7 @@ function setup({ stock = true, document = null, takeStock = true } = {}) {
|
||||
handler.fire(T.LEFT_CLICK, { position: at(x, y) }, modifier);
|
||||
};
|
||||
return {
|
||||
widget,
|
||||
input,
|
||||
port: input.port,
|
||||
handler,
|
||||
@@ -442,3 +443,31 @@ test('not taking the stock, they stay on the viewer’s handler but while held',
|
||||
'dispose gives a held one back',
|
||||
);
|
||||
});
|
||||
|
||||
test("a tool that does not hold off stock clicks leaves the viewer's select and double-click follow running; one that does stops them", async (t) => {
|
||||
const { inputFor } = await import('../../input/dispatcher.js');
|
||||
const { claimPointer, releasePointer } =
|
||||
await import('../../data/inputOwnership.js');
|
||||
const s = setup();
|
||||
// The dispatcher over this port, as the application's layers take input.
|
||||
const dispatcher = inputFor(s.widget, {
|
||||
query: { pick: () => null, drillPick: () => [] },
|
||||
});
|
||||
t.after(() => dispatcher.destroy());
|
||||
const placed = [];
|
||||
const lease = claimPointer('placing-tool');
|
||||
t.after(() => releasePointer(lease));
|
||||
dispatcher.onPointer('click', () => placed.push('tool'), { lease });
|
||||
s.press(5, 6);
|
||||
s.handler.fire(T.LEFT_DOUBLE_CLICK, { position: s.at(5, 6) });
|
||||
assert.deepEqual(placed, ['tool']);
|
||||
assert.equal(s.selected.length, 1, 'the stock select ran on its click');
|
||||
assert.equal(s.followed.length, 1, 'and the double-click follow');
|
||||
const hold = dispatcher.suppressStockClicks();
|
||||
s.press(5, 6);
|
||||
s.handler.fire(T.LEFT_DOUBLE_CLICK, { position: s.at(5, 6) });
|
||||
hold();
|
||||
assert.deepEqual(placed, ['tool', 'tool']);
|
||||
assert.equal(s.selected.length, 1, 'held off: no stock select');
|
||||
assert.equal(s.followed.length, 1, 'nor follow');
|
||||
});
|
||||
Reference in new issue
Block a user