From: Jean-Marc Lasgouttes Date: Tue, 11 Jun 2024 15:04:58 +0000 (+0200) Subject: InsetMathMacoTemplate: recompute metrics on editXY too X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fbiginset;p=features.git InsetMathMacoTemplate: recompute metrics on editXY too This inset can change dimensions when edited (like macros can). Therefore Update::SinglePar should be set with editXY() like it is already set for edit(). (cherry picked from commit b54d3520753f79231c9f09a45f4efd9c8ac2d90a) --- diff --git a/src/mathed/InsetMathMacroTemplate.cpp b/src/mathed/InsetMathMacroTemplate.cpp index 2a721833b0..4fb50b1a4c 100644 --- a/src/mathed/InsetMathMacroTemplate.cpp +++ b/src/mathed/InsetMathMacroTemplate.cpp @@ -613,6 +613,14 @@ void InsetMathMacroTemplate::edit(Cursor & cur, bool front, EntryDirection entry } +Inset * InsetMathMacroTemplate::editXY(Cursor & cur, int x, int y) +{ + updateLook(); + cur.screenUpdateFlags(Update::SinglePar); + return InsetMathNest::editXY(cur, x, y); +} + + bool InsetMathMacroTemplate::notifyCursorLeaves(Cursor const & old, Cursor & cur) { unsigned int const nargs_before = nargs(); diff --git a/src/mathed/InsetMathMacroTemplate.h b/src/mathed/InsetMathMacroTemplate.h index 105dcfb7ff..4cf993918c 100644 --- a/src/mathed/InsetMathMacroTemplate.h +++ b/src/mathed/InsetMathMacroTemplate.h @@ -41,6 +41,8 @@ public: /// void edit(Cursor & cur, bool front, EntryDirection entry_from) override; /// + Inset * editXY(Cursor & cur, int x, int y) override; + /// bool notifyCursorLeaves(Cursor const & old, Cursor & cur) override; /// void read(Lexer & lex) override;