mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Try to avoid horizontal scrolling with wide insets.
There was a problem with end of paragraph markers. By design, wide insets choose their size without taking in account the marker. This should not lead to unneeded horizontal scrolling. Part of ticket #9807.
This commit is contained in:
parent
88d1c790b6
commit
eb1e85b096
@ -3045,7 +3045,7 @@ void BufferView::checkCursorScrollOffset(PainterInfo & pi)
|
||||
int offset = d->horiz_scroll_offset_;
|
||||
int const MARGIN = 2 * theFontMetrics(d->cursor_.real_current_font).em()
|
||||
+ row.right_margin;
|
||||
if (row.width() <= workWidth() - row.right_margin) {
|
||||
if (row.right_x() <= workWidth() - row.right_margin) {
|
||||
// Row is narrower than the work area, no offset needed.
|
||||
offset = 0;
|
||||
} else {
|
||||
@ -3059,8 +3059,8 @@ void BufferView::checkCursorScrollOffset(PainterInfo & pi)
|
||||
// Correct the offset to make sure that we do not scroll too much
|
||||
if (offset < 0)
|
||||
offset = 0;
|
||||
if (row.width() - offset < workWidth() - row.right_margin)
|
||||
offset = row.width() - workWidth() + row.right_margin;
|
||||
if (row.right_x() - offset < workWidth() - row.right_margin)
|
||||
offset = row.right_x() - workWidth() + row.right_margin;
|
||||
}
|
||||
|
||||
//lyxerr << "cur_x=" << cur_x << ", offset=" << offset << ", row.wid=" << row.width() << ", margin=" << MARGIN << endl;
|
||||
|
Loading…
Reference in New Issue
Block a user