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

Function clampDesktopCoordinate

codersdk/workspacesdk/display.go:165–176  ·  view source on GitHub ↗
(coord, dim int)

Source from the content-addressed store, hash-verified

163}
164
165func clampDesktopCoordinate(coord, dim int) int {
166 if dim <= 0 {
167 return 0
168 }
169 if coord < 0 {
170 return 0
171 }
172 if coord >= dim {
173 return dim - 1
174 }
175 return coord
176}
177
178func sanitizeDesktopDimension(dim int) int {
179 if dim <= 0 {

Callers 1

scaleDesktopCoordinateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected