mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 02:14:50 +00:00
Fix crash when selection begins or ends outside the visible screen.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19992 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
4048448236
commit
8695368e29
@ -1703,6 +1703,11 @@ void TextMetrics::drawSelection(PainterInfo & pi, int x, int) const
|
||||
|| bv_funcs::status(bv_, end) == bv_funcs::CUR_ABOVE)
|
||||
return;
|
||||
|
||||
if (beg.pit() < par_metrics_.begin()->first)
|
||||
beg.pit() = par_metrics_.begin()->first;
|
||||
if (end.pit() > par_metrics_.rbegin()->first)
|
||||
end.pit() = par_metrics_.rbegin()->first;
|
||||
|
||||
ParagraphMetrics const & pm1 = par_metrics_[beg.pit()];
|
||||
ParagraphMetrics const & pm2 = par_metrics_[end.pit()];
|
||||
Row const & row1 = pm1.getRow(beg.pos(), beg.boundary());
|
||||
|
Loading…
Reference in New Issue
Block a user