Skip to content

Improve code quality of picker.mjs #57

@plhrtr

Description

@plhrtr
  • 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
  • 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
  • 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
  • Check if deselectAll() should reset the this.#selectedObject
  • Should itemSelectedEvent() be renamed to dispatchItemSelectedEvent()?
  • In setUpMouseEvents(): find a better name for canvasChild or add a comment explaining what exactly the last child of canvas is
  • Can we use this.#canvas in itemSelectedEvent()?

Metadata

Metadata

Assignees

Labels

code qualityRefactoring and other improvements to code qualitydocumentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions