Files
SnapGo/internal/infrastructure/display/display.go
T
mamamiyear ceecbb6af4 feat(app): implement basic function
General
- 配置界面支持配置对象存储桶
- 快捷键进入截图
- 一键上传截图 & 复制截图链接

MacOS
- 状态栏指示器和应用图标
2026-06-01 21:17:29 +08:00

26 lines
1.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 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
}