mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
Avoid empty space above the top of the document
If the height of the first row of the document has become smaller (for
example when it contains an image which size has shrunk), that the
anchor offset has to be adapted so that there is not a large blank
space at the top of the document.
(cherry picked from commit d6aecbda0f
)
This commit is contained in:
parent
4f50cbcfe4
commit
cda56c0dc3
@ -2698,10 +2698,10 @@ void BufferView::updateMetrics()
|
||||
// Complete buffer visible? Then it's easy.
|
||||
if (scrollRange == 0)
|
||||
d->anchor_ypos_ = anchor_pm.ascent();
|
||||
|
||||
// FIXME: Some clever handling needed to show
|
||||
// the _first_ paragraph up to the top if the cursor is
|
||||
// in the first line.
|
||||
else {
|
||||
// avoid empty space above the first row
|
||||
d->anchor_ypos_ = min(d->anchor_ypos_, anchor_pm.ascent());
|
||||
}
|
||||
}
|
||||
anchor_pm.setPosition(d->anchor_ypos_);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user