popup: flip above the pointer at the bottom edge

Without a caret the popup sat at pointer+10 and was clamped upward at
the bottom of the work area, covering the pointer; it now goes above the
pointer like it goes above a caret.
This commit is contained in:
2026-08-16 21:36:31 +09:00
parent 45c6be7e1b
commit 6b1de2df4f
2 changed files with 4 additions and 0 deletions

View File

@@ -259,6 +259,8 @@ popupposition(Caret *caret, int pointerx, int pointery, Area *area,
}else{
px = (vlong)pointerx + 10;
py = (vlong)pointery + 10;
if(py + h > bottom)
py = (vlong)pointery - 10 - h;
}
xmax = max(right - w, area->x);
ymax = max(bottom - h, area->y);