ceecbb6af4
General - 配置界面支持配置对象存储桶 - 快捷键进入截图 - 一键上传截图 & 复制截图链接 MacOS - 状态栏指示器和应用图标
26 lines
1.0 KiB
Go
26 lines
1.0 KiB
Go
// Package display exposes platform-specific helpers for reading the
|
||
// geometry of the primary display, in both CSS (logical) and PHYSICAL
|
||
// pixels. The overlay flow needs both: CSS pixels to size the Wails window
|
||
// to "fullscreen" (since Wails uses CSS-px-equivalent units), and the
|
||
// backing scale factor to translate the user's CSS-px selection rectangle
|
||
// into the physical-pixel rectangle of the captured PNG.
|
||
package display
|
||
|
||
// Info describes the primary display.
|
||
//
|
||
// The struct is deliberately minimal: only the few fields the overlay flow
|
||
// actually needs. We can grow it later without affecting callers because
|
||
// it is returned by value.
|
||
type Info struct {
|
||
// CSSWidth / CSSHeight are the logical dimensions of the primary
|
||
// display in points (i.e. what CSS / Wails uses).
|
||
CSSWidth int
|
||
CSSHeight int
|
||
|
||
// Scale is backing factor (CSS-px → device-px). 2 on Retina, 1 on
|
||
// non-Retina. We model it as float64 to leave room for fractional
|
||
// scales (e.g. Linux 1.25×) even though macOS effectively only ever
|
||
// reports 1 or 2.
|
||
Scale float64
|
||
}
|