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

Method NativePointToDeclared

codersdk/workspacesdk/display.go:103–106  ·  view source on GitHub ↗

NativePointToDeclared maps a point from native desktop coordinates to the declared model-facing coordinate space using the same truncating transform.

(x, y int)

Source from the content-addressed store, hash-verified

101// NativePointToDeclared maps a point from native desktop coordinates to the
102// declared model-facing coordinate space using the same truncating transform.
103func (g DesktopGeometry) NativePointToDeclared(x, y int) (declaredX, declaredY int) {
104 return scaleDesktopCoordinate(x, g.NativeWidth, g.DeclaredWidth),
105 scaleDesktopCoordinate(y, g.NativeHeight, g.DeclaredHeight)
106}
107
108func computeDeclaredDesktopSize(nativeWidth, nativeHeight int) (declaredWidth, declaredHeight int) {
109 if desktopSizeFitsDeclaredLimits(nativeWidth, nativeHeight) {

Callers 2

handleActionMethod · 0.80

Calls 1

scaleDesktopCoordinateFunction · 0.85

Tested by 1