]> git.lyx.org Git - features.git/commitdiff
* BufferView::workAreaDispatch(): reconstruct the ViewMetricsInfo in any case when...
authorAbdelrazak Younes <younes@lyx.org>
Tue, 25 Sep 2007 08:47:54 +0000 (08:47 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 25 Sep 2007 08:47:54 +0000 (08:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20483 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp

index a753500b22cdd41a45674b059b2a11e142b9ba19..0cef0e7ef3804d357dcb817c58a4ff13586f5e1d 100644 (file)
@@ -1114,22 +1114,23 @@ bool BufferView::workAreaDispatch(FuncRequest const & cmd0)
 
                // if last metrics update was in singlepar mode, WorkArea::redraw() will
                // not expose the button for redraw. We adjust here the metrics dimension
-               // to enable a full redraw.
-               if (metrics_info_.update_strategy == SingleParUpdate) {
-                       // Build temporary cursor.
-                       TextMetrics & tm = text_metrics_[&buffer_.text()];
-                       tm.editXY(cur, cmd.x, cmd.y);
-                       // collect cursor paragraph iter bounds
-                       std::pair<pit_type, ParagraphMetrics const *> firstpm = tm.first();
-                       std::pair<pit_type, ParagraphMetrics const *> lastpm = tm.last();
-                       int y1 = firstpm.second->position() - firstpm.second->ascent();
-                       int y2 = lastpm.second->position() + lastpm.second->descent();
-                       metrics_info_ = ViewMetricsInfo(firstpm.first, lastpm.first, y1, y2,
-                               FullScreenUpdate, buffer_.text().paragraphs().size());
-                       // Reinitialize anchor to first pit.
-                       anchor_ref_ = firstpm.first;
-                       offset_ref_ = -y1;
-               }
+               // to enable a full redraw in any case as this is not costly.
+               TextMetrics & tm = text_metrics_[&buffer_.text()];
+               tm.editXY(cur, cmd.x, cmd.y);
+               // collect cursor paragraph iter bounds
+               std::pair<pit_type, ParagraphMetrics const *> firstpm = tm.first();
+               std::pair<pit_type, ParagraphMetrics const *> lastpm = tm.last();
+               int y1 = firstpm.second->position() - firstpm.second->ascent();
+               int y2 = lastpm.second->position() + lastpm.second->descent();
+               metrics_info_ = ViewMetricsInfo(firstpm.first, lastpm.first, y1, y2,
+                       FullScreenUpdate, buffer_.text().paragraphs().size());
+               // Reinitialize anchor to first pit.
+               anchor_ref_ = firstpm.first;
+               offset_ref_ = -y1;
+               LYXERR(Debug::PAINTING)
+                       << "Mouse hover detected at: (" << cmd.x << ", " << cmd.y << ")"
+                       << "\nTriggering redraw: y1: " << y1 << " y2: " << y2
+                       << " pit1: " << firstpm.first << " pit2: " << lastpm.first << endl;
 
                // This event (moving without mouse click) is not passed further.
                // This should be changed if it is further utilized.