commit 75108675ba5859ea15b873f1ada57e1b36f84cec
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Mon Sep 27 17:46:38 2021 +0200

    Make rectangles have pointy corners
    
    This only makes a difference in HiDpi mode.
    
    Adaptation of the patch proposed by Daniel.
    
    Fix for bug #12336.
    
    (cherry picked from commit 3cdfb42cced175c108563f378589ec9aae134093)
---
 src/frontends/qt4/GuiPainter.cpp |    6 ++++--
 src/frontends/qt4/GuiPainter.h   |    3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/frontends/qt4/GuiPainter.cpp b/src/frontends/qt4/GuiPainter.cpp
index a9afb3b..13f699c 100644
--- a/src/frontends/qt4/GuiPainter.cpp
+++ b/src/frontends/qt4/GuiPainter.cpp
@@ -67,7 +67,7 @@ GuiPainter::~GuiPainter()
 
 
 void GuiPainter::setQPainterPen(QColor const & col,
-       Painter::line_style ls, int lw)
+       Painter::line_style ls, int lw, Qt::PenJoinStyle js)
 {
        if (col == current_color_ && ls == current_ls_ && lw == current_lw_)
                return;
@@ -89,6 +89,8 @@ void GuiPainter::setQPainterPen(QColor const & col,
 
        pen.setWidth(lw);
 
+       pen.setJoinStyle(js);
+
        setPen(pen);
 }
 
@@ -266,7 +268,7 @@ void GuiPainter::rectangle(int x, int y, int w, int h,
        line_style ls,
        int lw)
 {
-       setQPainterPen(computeColor(col), ls, lw);
+       setQPainterPen(computeColor(col), ls, lw, Qt::MiterJoin);
        drawRect(x, y, w, h);
 }
 
diff --git a/src/frontends/qt4/GuiPainter.h b/src/frontends/qt4/GuiPainter.h
index 7513965..1581cca 100644
--- a/src/frontends/qt4/GuiPainter.h
+++ b/src/frontends/qt4/GuiPainter.h
@@ -179,7 +179,8 @@ private:
 
        /// set pen parameters
        void setQPainterPen(QColor const & col,
-               line_style ls = line_solid, int lw = thin_line);
+               line_style ls = line_solid, int lw = thin_line,
+               Qt::PenJoinStyle js = Qt::BevelJoin);
 
        // Direction for painting text
        enum Direction { LtR, RtL, Auto };
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to