video: Document the quirk in truetype_get_cursor_info()

The current code is written to suggest that the cursor position
(priv->pos_ptr) might be respected. In fact a bug means that it never
is, since index is set to priv->pos_ptr, so the if() condition always
fails.

Further, when editing textline objects, the cursor index is always the
same as priv->pos_ptr anyway. Fix the bug but keep the current
behaviour, adding a comment for future readers.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
This commit is contained in:
Simon Glass
2025-12-07 04:57:33 -07:00
parent 1966c328b5
commit a9027c8eb5

View File

@@ -1097,9 +1097,13 @@ static int truetype_get_cursor_info(struct udevice *dev)
* figure out where to place the cursor. This driver ignores the
* passed-in values, since an entry_restore() must have been done before
* calling this function.
*
* A current quirk is that the cursor is always at xcur_frac, since we
* output characters directly to the console as they are typed by the
* user. So we never bother with priv->pos[index] for now.
*/
index = priv->pos_ptr;
if (index < priv->pos_ptr)
if (0 && index < priv->pos_count)
x = VID_TO_PIXEL(priv->pos[index].xpos_frac);
else
x = VID_TO_PIXEL(vc_priv->xcur_frac);