MCPcopy Index your code
hub / github.com/coder/coder / DeclaredPointToNative

Method DeclaredPointToNative

codersdk/workspacesdk/display.go:96–99  ·  view source on GitHub ↗

DeclaredPointToNative maps a point from declared model-facing coordinates to native desktop coordinates using the existing pixel-center truncation rule.

(x, y int)

Source from the content-addressed store, hash-verified

94// DeclaredPointToNative maps a point from declared model-facing coordinates to
95// native desktop coordinates using the existing pixel-center truncation rule.
96func (g DesktopGeometry) DeclaredPointToNative(x, y int) (nativeX, nativeY int) {
97 return scaleDesktopCoordinate(x, g.DeclaredWidth, g.NativeWidth),
98 scaleDesktopCoordinate(y, g.DeclaredHeight, g.NativeHeight)
99}
100
101// NativePointToDeclared maps a point from native desktop coordinates to the
102// declared model-facing coordinate space using the same truncating transform.

Calls 1

scaleDesktopCoordinateFunction · 0.85

Tested by 1