popup: place and bound the input panel
This commit is contained in:
@@ -5,11 +5,15 @@ void
|
||||
popupposition(Caret *caret, int pointerx, int pointery, int screenw,
|
||||
int screenh, int w, int h, int *x, int *y)
|
||||
{
|
||||
vlong px, py, xmax, ymax;
|
||||
vlong below, px, py, xmax, ymax;
|
||||
|
||||
if(caret->valid){
|
||||
px = caret->x;
|
||||
py = (vlong)caret->y + max(caret->h, 0);
|
||||
below = (vlong)caret->y + max(caret->h, 0);
|
||||
if(below >= 0 && below + h <= screenh)
|
||||
py = below;
|
||||
else
|
||||
py = (vlong)caret->y - h;
|
||||
}else{
|
||||
px = (vlong)pointerx + 10;
|
||||
py = (vlong)pointery + 10;
|
||||
|
||||
Reference in New Issue
Block a user