Skip to content

Z fits a turned part with width and height swapped #142

Closed

Description

@Gherkin

zoomToFootprint (web/render.js, used by Z, a click on a part row, and a link focused on a part) sizes the view from bbox.size as it is. It ignores two turns:

  • The part's angle. The drawing turns the box by bbox.angle (render-worker.js:887). A part at ±90° gets width and height swapped. Half the parts in netdaq-small and three quarters in ciaa-acc have a nonzero angle.
  • The board rotation. At 90° or 270°, the board's width runs up the screen, but the fit still compares size[0] to the canvas width.

It also repeats the fit math in zoomFitPoints, with a different zoom limit (50 against 200).

Fix: call zoomFitPoints with footprintCorners(fp) (added in #141). That handles both turns. One choice is left: which zoom limit to keep for a single part.

Related: #141 (E fits a turned pinned part). Not yet seen in the browser: pin a long part at 90° and press Z.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpr 135 reviewFollow-ups from the review of PR #135

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions