mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
fix Row::findElement when there is a Virtual element
This commit is contained in:
parent
51b37cd4d8
commit
e1261817d2
14
src/Row.cpp
14
src/Row.cpp
@ -626,13 +626,15 @@ Row::findElement(pos_type const pos, bool const boundary, double & x) const
|
||||
|
||||
const_iterator cit = begin();
|
||||
for ( ; cit != end() ; ++cit) {
|
||||
/** Look whether the cursor is inside the element's
|
||||
* span. Note that it is necessary to take the
|
||||
* boundary into account, and to accept virtual
|
||||
* elements, which have pos == endpos.
|
||||
/** Look whether the cursor is inside the element's span. Note
|
||||
* that it is necessary to take the boundary into account, and
|
||||
* to accept virtual elements, in which case the position
|
||||
* will be before the virtual element.
|
||||
*/
|
||||
if (pos + boundary_corr >= cit->pos
|
||||
&& (pos + boundary_corr < cit->endpos || cit->isVirtual())) {
|
||||
if (cit->isVirtual() && pos + boundary_corr == cit->pos)
|
||||
break;
|
||||
else if (pos + boundary_corr >= cit->pos
|
||||
&& pos + boundary_corr < cit->endpos) {
|
||||
x += cit->pos2x(pos);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user