MCPcopy Create free account
hub / github.com/cogentcore/core / WinSizeFromPix

Method WinSizeFromPix

system/screen.go:165–170  ·  view source on GitHub ↗

WinSizeFromPix returns window manager size units (where DevicePixelRatio is ignored) converted from pixel units -- i.e., divide by DevicePixelRatio

(sz image.Point)

Source from the content-addressed store, hash-verified

163// (where DevicePixelRatio is ignored) converted from pixel units --
164// i.e., divide by DevicePixelRatio
165func (sc *Screen) WinSizeFromPix(sz image.Point) image.Point {
166 var wsz image.Point
167 wsz.X = int(float32(sz.X) / sc.DevicePixelRatio)
168 wsz.Y = int(float32(sz.Y) / sc.DevicePixelRatio)
169 return wsz
170}
171
172// ConstrainWinGeom constrains window geometry to fit in the screen.
173// Size is in pixel units.

Callers 6

ConstrainWinGeomMethod · 0.95
FixupMethod · 0.80
NewGlfwWindowFunction · 0.80
SetGeomMethod · 0.80
SetSizeMethod · 0.80
SetGeomMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected