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

Function coordFromAction

agent/x/agentdesktop/api.go:737–742  ·  view source on GitHub ↗

coordFromAction extracts the coordinate pair from a DesktopAction, returning an error if the coordinate field is missing.

(action DesktopAction)

Source from the content-addressed store, hash-verified

735// coordFromAction extracts the coordinate pair from a DesktopAction,
736// returning an error if the coordinate field is missing.
737func coordFromAction(action DesktopAction) (x, y int, err error) {
738 if action.Coordinate == nil {
739 return 0, 0, &missingFieldError{field: "coordinate", action: action.Action}
740 }
741 return action.Coordinate[0], action.Coordinate[1], nil
742}
743
744func desktopGeometryForAction(cfg DisplayConfig, action DesktopAction) workspacesdk.DesktopGeometry {
745 declaredWidth := cfg.Width

Callers 1

handleActionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected