Zoom to Fit, with a toolbar icon beside the zoom controls
Fits the whole painted sheet in the visible canvas and scrolls it into view, from the View menu, Ctrl/Cmd+9, or the four-corners button after the zoom percentage. The ladder gains 25% and 33% at the bottom, so a wide sheet has somewhere to fit into. Fit is the one scale that is not on the ladder -- a sheet fits at whatever scale it fits at -- so zoom_step now takes the first level above or below the scale in force rather than the neighbour of the nearest rung. The sheet is measured from item coordinates rather than canvas.bbox(), which is inflated by the outline stroke: a stroke is the same two pixels at every zoom, so a bbox divided back to 1:1 reports a slightly smaller sheet the further in it is zoomed, and fitting an already fitted sheet crept from 288% to 291% instead of standing still. Anything painted left of or above the canvas origin is measured from the origin, since no amount of scrolling brings it into view. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -87,6 +87,7 @@ Undoing back to the depth of the last save clears the dirty tint rather than lea
|
||||
| `Alt` + `Left` / `Alt` + `Right` | Back and forward through the sheets opened this session |
|
||||
| `Ctrl`/`Cmd` + `+` / `-` | Zoom the sheet in and out |
|
||||
| `Ctrl`/`Cmd` + `0` | Zoom back to 100% |
|
||||
| `Ctrl`/`Cmd` + `9` | Zoom to Fit: show the whole sheet |
|
||||
| `Ctrl` + wheel | Zoom around the pointer |
|
||||
|
||||
Both `Command-` and `Control-` are bound for each, so the same build works on macOS and
|
||||
@@ -99,8 +100,16 @@ exception, on `Control-` alone: `Cmd` + `W` closes the window on macOS.
|
||||
it back at its configured width. ttk has no hide flag for a pane, so the column is dropped
|
||||
from the paned window and re-inserted at the front.
|
||||
|
||||
**Zoom In**, **Zoom Out** and **Zoom 100%** step a ladder of scales, with the two zoom
|
||||
buttons and the percentage sitting beside the navigation arrows in the toolbar. The sheet
|
||||
**Zoom In**, **Zoom Out** and **Zoom 100%** step a ladder of scales from 25% to 300%,
|
||||
with the zoom buttons, the percentage and the fit icon sitting beside the navigation
|
||||
arrows in the toolbar. **Zoom to Fit** is the one thing that lands between the ladder's
|
||||
rungs -- a sheet fits at whatever scale it fits at -- and stepping in or out from there
|
||||
rejoins the ladder. It measures the sheet from item coordinates rather than
|
||||
`canvas.bbox()`, which is inflated by the outline stroke: a stroke is the same two pixels
|
||||
at every zoom, so a bbox divided back to 1:1 reports a slightly smaller sheet the further
|
||||
in it is zoomed, and fitting an already fitted sheet would creep instead of standing
|
||||
still. Anything painted left of or above the canvas origin is measured from the origin
|
||||
instead, since no amount of scrolling can bring it into view. The sheet
|
||||
is painted and routed at 1:1 -- box metrics, wire stubs, lane gaps, clearances and knob
|
||||
radii are all tuned in those pixels -- and `apply_sheet_zoom` scales the finished picture,
|
||||
so a zoomed sheet keeps exactly the proportions of a 1:1 one and the router makes the same
|
||||
|
||||
Reference in New Issue
Block a user