ARTIST-Association / ARTIST-Association/CANVAS
Improve code quality of picker.mjs
- Dominant language
- Python
- Stars
- 6
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
- [x] Add a comment with more info on the normalization in `mouseposition()`
- presumably: normalization to [-1, 1] and inverting the y axis to go from DOM to three.js world space
- [x] Simplify if-statements in `updateSelectionBox()`, `attachSingleTransformControl()`, and `updateSelection()`
- reduce unnecessary nesting of if-statements and merge if-branches with the same outcome/shared code
- set `showX = (axis === "X")` etc directly if possible
- [x] Consistence use of `this.#selectedObject`, `this.#transformControls.object`, and `this.#selectedObjects[0]`
- Should they be identical (in most cases) or are there significant differences?
- If identical → is it sufficient to just use `this.#selectedObject`?
- If not identical → clarify how they differ
- [x] Check if `deselectAll()` should reset the `this.#selectedObject`
- [x] Should `itemSelectedEvent()` be renamed to `dispatchItemSelectedEvent()`?
- [x] In `setUpMouseEvents()`: find a better name for `canvasChild` or add a comment explaining what exactly the last child of canvas is
- [x] Can we use `this.#canvas` in `itemSelectedEvent()`?
Contributor guide
Assessment
This issue has not been assessed yet.