This commit is contained in:
p.kosyh 2010-09-02 08:34:01 +00:00
parent 534226d5e9
commit 0e287654f3

View file

@ -2459,10 +2459,14 @@ xref_t txt_box_xref(textbox_t tbox, int x, int y)
continue;
if (x < word->x + word->w)
break;
if (word->next && word->next->xref == xref && x < word->next->x + word->next->w)
if (word->next && word->next->xref == xref && x < word->next->x + word->next->w) {
yy = vertical_align(word->next, &hh);
if (y < line->y + yy || y > line->y + yy + hh)
continue;
break;
}
}
}
if (word && xref) {
return xref;
}
@ -2991,10 +2995,14 @@ xref_t txt_layout_xref(layout_t lay, int x, int y)
continue;
if (x <= word->x + word->w)
return xref;
if (word->next && word->next->xref == xref && x < word->next->x + word->next->w)
if (word->next && word->next->xref == xref && x < word->next->x + word->next->w) {
yy = vertical_align(word->next, &hh);
if (y < line->y + yy || y > line->y + yy + hh)
continue;
return xref;
}
}
}
return NULL;
}