commit 971514b176214b843fb2812d25f4e5cb77eb0d28
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Sun Jun 29 18:23:56 2025 +0200

    Make sure to redraw paragraph when entering Preview inset (1/2)
    
    This one covers the case where one enters the inset using cursor
    movement.
---
 src/insets/InsetPreview.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/insets/InsetPreview.cpp b/src/insets/InsetPreview.cpp
index 52250911ea..0af51d408c 100644
--- a/src/insets/InsetPreview.cpp
+++ b/src/insets/InsetPreview.cpp
@@ -158,8 +158,17 @@ void InsetPreview::draw(PainterInfo & pi, int x, int y) 
const
 
 void InsetPreview::edit(Cursor & cur, bool front, EntryDirection entry_from)
 {
+       bool const has_preview = previewState(&cur.bv());
        cur.push(*this);
        InsetText::edit(cur, front, entry_from);
+       if (has_preview) {
+               // The inset formula dimension is in general different from the
+               // one of the instant preview image, so we have to indicate to 
the
+               // BufferView that a metrics update is needed.
+               // FIXME : it should be possible to trigger a SinglePar update
+               //   on the parent paragraph.
+               cur.bv().processUpdateFlags(Update::Force);
+       }
 }
 
 
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to