#242·UI-TARS

fix: convert_point_to_coordinates computes x and y from x1+x1 instead of x1+x2

Author: kuishou68Created Apr 14, 2026Updated Apr 14, 2026

Bug

In codes/ui_tars/action_parser.py, the convert_point_to_coordinates function contains a copy-paste error:

python
x = (x1 + x1) // 2  # BUG: should use x2
y = (y1 + y1) // 2  # BUG: should use y2

Both x and y are computed using only the first coordinate repeated (x1+x1 and y1+y1), instead of averaging the two coordinates (x1+x2 and y1+y2). This means the midpoint is always equal to x1 and y1, ignoring x2 and y2 entirely — so the function always returns the top-left corner of the bounding box instead of its center.

Fix

Change:

python
x = (x1 + x1) // 2
y = (y1 + y1) // 2

To:

python
x = (x1 + x2) // 2
y = (y1 + y2) // 2