mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Temporarily fix jumpy cursor.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20526 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c1540f8d92
commit
5e8d4df0a5
@ -251,8 +251,13 @@ bool BufferView::update(Update::flags flags)
|
||||
bool const single_par = !full_metrics;
|
||||
updateMetrics(single_par);
|
||||
|
||||
if (flags & Update::FitCursor && fitCursor())
|
||||
updateMetrics(false);
|
||||
if (flags & Update::FitCursor) {
|
||||
//FIXME: updateMetrics() does not update paragraph position
|
||||
// This is done at draw() time. So we need a redraw!
|
||||
buffer_.changed();
|
||||
if (fitCursor())
|
||||
updateMetrics(false);
|
||||
}
|
||||
|
||||
// tell the frontend to update the screen.
|
||||
return true;
|
||||
|
@ -172,11 +172,9 @@ ParagraphMetrics & TextMetrics::parMetrics(pit_type pit,
|
||||
|
||||
int TextMetrics::parPosition(pit_type pit) const
|
||||
{
|
||||
pair<pit_type, ParagraphMetrics> first = *par_metrics_.begin();
|
||||
pair<pit_type, ParagraphMetrics> last = *par_metrics_.rbegin();
|
||||
if (pit < first.first)
|
||||
return -1000000;
|
||||
else if (pit > last.first)
|
||||
if (pit < par_metrics_.begin()->first)
|
||||
return -1000000;
|
||||
else if (pit > par_metrics_.rbegin()->first)
|
||||
return +1000000;
|
||||
|
||||
return par_metrics_[pit].position();
|
||||
|
Loading…
Reference in New Issue
Block a user