2 Commits
Author SHA1 Message Date
Mathieu Rancourt 5004d96acb Lost window device: quitting goes through while recovery can't be saved (#8620)
After the window's GPU device is lost, nothing can be drawn (#6464). When
saving the unsaved work for recovery keeps failing (a full disk, an
unwritable or missing recovery folder), the app keeps retrying. Quitting
(the title bar's close button, File › Exit, the window manager's close)
then parked the quit behind the unsaved-changes prompt, which can never
show, so the blank window could not be closed. discard_ui::intercept now
lets a quit through once the device is lost, with a warning in the log.
2026-10-23 17:41:31 -04:00
Mathieu Rancourt 5de94a7e05 Slice tool: Style offers Fixed Ratio and Fixed Size (#8360) (#8638)
* Slice tool: Style offers Fixed Ratio and Fixed Size (#8360)

The Slice tool's options bar showed "Style: Normal" as plain text, so a
slice could only be drawn freely. It now has the marquee's Style dropdown
(Normal, Fixed Ratio, Fixed Size) with Width and Height, and a new slice
follows it while it is drawn and when it is made, through the marquee's
chrome_ui::marquee_end. The options are kept with the other tool options,
checked when loaded, and reset by Reset Tool.

* Slice tool: a Fixed Size slice has exactly its size, also a pixel or two

A press inside a pixel (10.25) made a 64 x 64 Fixed Size slice 65 x 65
pixels, since its far edge was rounded out. Fixed Size now starts on the
pixel the press is in. A Fixed Size of 1 or 2 pixels was taken for a click
that selects; Fixed Size makes its slice at any size.

* Slice tool: Fixed Ratio keeps its ratio and Fixed Size whole pixels

A fractional drag rounded each edge of a Fixed Ratio slice apart, so 2 : 1
could become 5 x 3. A fixed style now starts on the pixel the press is in
and takes both sides from one scale: a whole-number ratio comes in whole
multiples of it in its lowest terms, any other as close as whole pixels
allow. Fixed Size rounds its Width and Height to whole pixels, in the
field and when the slice is made, so 1.5 px no longer grows to 2.

* Slice tool: Fixed Ratio follows the drag, Fixed Size fields in whole px

Whole multiples of the ratio grew a 1366 : 768 slice in steps of 683 px,
made a 4 x 1 slice from a plain click under 4 : 1, and jumped a 39.8 px
16 : 9 drag to 48 x 27. The longer side now follows the drag to within a
pixel and the shorter side takes the ratio from it. Fixed Size Width and
Height show whole pixels, so the field matches the slice it makes.
2026-10-23 17:41:25 -04:00