Skip to content

Commit 4094aca

Browse files
committed
one more bot comment
1 parent 20aab2f commit 4094aca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/cmd/api/api/computer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (s *ApiService) MoveMouse(ctx context.Context, request oapi.MoveMouseReques
3737
return oapi.MoveMouse400JSONResponse{BadRequestErrorJSONResponse: oapi.BadRequestErrorJSONResponse{Message: "coordinates must be non-negative"}}, nil
3838
}
3939
if body.X >= screenWidth || body.Y >= screenHeight {
40-
return oapi.MoveMouse400JSONResponse{BadRequestErrorJSONResponse: oapi.BadRequestErrorJSONResponse{Message: fmt.Sprintf("coordinates exceed screen bounds (max: %dx%d)", screenWidth, screenHeight)}}, nil
40+
return oapi.MoveMouse400JSONResponse{BadRequestErrorJSONResponse: oapi.BadRequestErrorJSONResponse{Message: fmt.Sprintf("coordinates exceed screen bounds (max: %dx%d)", screenWidth-1, screenHeight-1)}}, nil
4141
}
4242

4343
// Build xdotool arguments
@@ -95,7 +95,7 @@ func (s *ApiService) ClickMouse(ctx context.Context, request oapi.ClickMouseRequ
9595
return oapi.ClickMouse400JSONResponse{BadRequestErrorJSONResponse: oapi.BadRequestErrorJSONResponse{Message: "coordinates must be non-negative"}}, nil
9696
}
9797
if body.X >= screenWidth || body.Y >= screenHeight {
98-
return oapi.ClickMouse400JSONResponse{BadRequestErrorJSONResponse: oapi.BadRequestErrorJSONResponse{Message: fmt.Sprintf("coordinates exceed screen bounds (max: %dx%d)", screenWidth, screenHeight)}}, nil
98+
return oapi.ClickMouse400JSONResponse{BadRequestErrorJSONResponse: oapi.BadRequestErrorJSONResponse{Message: fmt.Sprintf("coordinates exceed screen bounds (max: %dx%d)", screenWidth-1, screenHeight-1)}}, nil
9999
}
100100

101101
// Map button enum to xdotool button code. Default to left button.

0 commit comments

Comments
 (0)