mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Remove premature (and bad) optimization
When blinking the caret, it looks like a cool idea to only update the small rectangle containing the caret. Actually it is an awful idea, since the paint event will paint some rows, and these rows will not be properly painted outside of the small rectangle. Unfortunately, the painter will skip those "painted" rows on next paint events. This leads to painting errors that depend on the ordering of "real" and "caret" paint events. This is the reason why they only appeared with split screens. Quote of the day: ``The real problem is that programmers have spent far too much time worrying about efficiency in the wrong places and at the wrong times; premature optimization is the root of all evil (or at least most of it) in programming.'' -- Donald Knuth, The Art of Computer Programming. Fixes bug #11354.
This commit is contained in:
parent
8d927de5ee
commit
fba9f5b9e8
@ -639,7 +639,7 @@ void GuiWorkArea::Private::showCaret()
|
||||
return;
|
||||
|
||||
updateCaretGeometry();
|
||||
p->viewport()->update(caret_->rect());
|
||||
p->viewport()->update();
|
||||
}
|
||||
|
||||
|
||||
@ -650,7 +650,7 @@ void GuiWorkArea::Private::hideCaret()
|
||||
|
||||
caret_visible_ = false;
|
||||
//if (!qApp->focusWidget())
|
||||
p->viewport()->update(caret_->rect());
|
||||
p->viewport()->update();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user