Reported: "钉在屏幕上的图片放大按钮无效." There was no enlarge button to
be ineffective — the pin window shipped exactly two actions, copy and
close, so the third press a user went looking for did not exist.
One button now covers both directions: fill the screen, or return to the
size the image was pinned at. An enlarged pin that cannot be shrunk back
is no longer usable as a reference, and a second control for that would
spend hover space on the less common half of the gesture.
Sizing and placement are the whole feature, and both are pinned by tests
because each is correct on the machine that builds it and wrong elsewhere:
- the bound is the monitor's work area, not its size, or the window grows
under the menu bar and a borderless window cannot be dragged back onto
itself;
- `set_size` is told in logical pixels and `set_position` in physical
ones, which on a 2x display is the difference between filling the screen
and filling it twice from the wrong corner;
- size is set before position, because on a mixed-DPI desktop resizing can
move a window onto another monitor and change its own scale factor;
- growth is capped at 3x, since the preview is already capped at 1040 px
and past that the button delivers mosaic, not detail;
- the window grows from its centre and is clamped inside the work area, so
a pin parked against a screen edge grows inward rather than off.
A fresh pin always opens at the small size. The window is reused rather
than rebuilt, so without that a user who enlarged once would find every
later pin arriving full-screen and soft.
Co-Authored-By: Codex <noreply@openai.com>