mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
feat(wind): render the inspection marker from a store
createWindInspectionMarker() moves to src/layers/wind/inspectionMarker.js, so the portable ./tools entry that reads wind/inspection.js stays free of Vue. It keeps the frame listener and projection and presents where the inspected point falls to the gev-wind-inspection store after each rendered frame, publishing nothing for an unchanged frame; the scene chrome teleports the marker into the wind layer's container with the same class, inline style, hidden state and position. The application guide lists everything leaving out the scene chrome now leaves out.
This commit is contained in:
1 parent
0926cbc105
commit
e0bfa471ac
13 files changed
+292
-131
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { markRaw, shallowRef } from 'vue';
|
||||
|
||||
/**
|
||||
* The wind inspection marker as its view renders it. The marker owner
|
||||
* (src/layers/wind/inspectionMarker.js) presents where the inspected point
|
||||
* falls on screen after every rendered frame.
|
||||
*/
|
||||
export const useWindInspectionStore = defineStore('gev-wind-inspection', () => {
|
||||
/**
|
||||
* `{owner, container, visible, left, top}`, in pixels from the container's
|
||||
* corner, or null while no point is inspected.
|
||||
*/
|
||||
const marker = shallowRef(null);
|
||||
|
||||
/** @param {?object} next A fresh presentation; every publish re-renders. */
|
||||
function publish(next) {
|
||||
marker.value = next && markRaw(next);
|
||||
}
|
||||
|
||||
return { marker, publish };
|
||||
});
|
||||
Reference in new issue
Block a user