From: Jean-Marc Lasgouttes Date: Mon, 24 Jul 2023 13:35:16 +0000 (+0200) Subject: Remove some redundant calls to updatePosCache X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d19ade9a611d3ecf6840c5eb43291cb268ad6f4f;p=features.git Remove some redundant calls to updatePosCache The setting of insets positions was done twice in updateMetrics. When one of the paragraph is a huge branch, this can be very expensive. This leads to a 17% improvement on updateMetrics time on a scrolling test. Part of bug #12297 --- diff --git a/src/BufferView.cpp b/src/BufferView.cpp index fd61401dff..3612143019 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -3161,7 +3161,6 @@ void BufferView::updateMetrics(Update::flags & update_flags) } } anchor_pm.setPosition(d->anchor_ypos_); - tm.updatePosCache(d->anchor_pit_); LYXERR(Debug::PAINTING, "metrics: " << " anchor pit = " << d->anchor_pit_ @@ -3177,7 +3176,6 @@ void BufferView::updateMetrics(Update::flags & update_flags) y1 -= pm.descent(); // Save the paragraph position in the cache. pm.setPosition(y1); - tm.updatePosCache(pit1); y1 -= pm.ascent(); } @@ -3191,7 +3189,6 @@ void BufferView::updateMetrics(Update::flags & update_flags) y2 += pm.ascent(); // Save the paragraph position in the cache. pm.setPosition(y2); - tm.updatePosCache(pit2); y2 += pm.descent(); }