commit 342a0f543812e21dade99b7fa46ea674075b8199
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Thu May 16 14:56:28 2024 +0200

    Fix display of math hull inset in RTL context
    
    The inversion of margin was done in the wrong way for RTL support.
    
    (cherry picked from commit b469c142ad579d3338fc81ab3e1c6ee7b4e270ec)
---
 src/TextMetrics.cpp | 13 ++++++++-----
 status.24x          |  1 +
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp
index 6968279c23..a694c997ea 100644
--- a/src/TextMetrics.cpp
+++ b/src/TextMetrics.cpp
@@ -2001,8 +2001,14 @@ void TextMetrics::drawParagraph(PainterInfo & pi, 
pit_type const pit, int const
                return;
        size_t const nrows = pm.rows().size();
        // Remember left and right margin for drawing math numbers
-       Changer changeleft = changeVar(pi.leftx, x + leftMargin(pit));
-       Changer changeright = changeVar(pi.rightx, x + width() - 
rightMargin(pit));
+       Changer changeleft, changeright;
+       if (text_->isRTL(pit)) {
+               changeleft = changeVar(pi.leftx, x + rightMargin(pit));
+               changeright = changeVar(pi.rightx, x + width() - 
leftMargin(pit));
+       } else {
+               changeleft = changeVar(pi.leftx, x + leftMargin(pit));
+               changeright = changeVar(pi.rightx, x + width() - 
rightMargin(pit));
+       }
 
        // Use fast lane in nodraw stage.
        if (pi.pain.isNull()) {
@@ -2049,9 +2055,6 @@ void TextMetrics::drawParagraph(PainterInfo & pi, 
pit_type const pit, int const
                }
        }
 
-       if (text_->isRTL(pit))
-               swap(pi.leftx, pi.rightx);
-
        BookmarksSection::BookmarkPosList bpl =
                
theSession().bookmarks().bookmarksInPar(bv_->buffer().fileName(), pm.id());
 
diff --git a/status.24x b/status.24x
index f3e8f6b07c..154a255304 100644
--- a/status.24x
+++ b/status.24x
@@ -41,6 +41,7 @@ What's new
 
 * USER INTERFACE
 
+- fix display of equation numbers in right-to-left context.
 
 * INTERNALS
 
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to