]> git.lyx.org Git - lyx.git/commitdiff
Make rectangles have pointy corners
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 27 Sep 2021 15:46:38 +0000 (17:46 +0200)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Wed, 23 Nov 2022 02:22:13 +0000 (21:22 -0500)
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
src/frontends/qt4/GuiPainter.h

index a9afb3b9731ac397e24a33c70d75628c5c8c5230..13f699ccb0d58ead43020367266bd7e64cca1b19 100644 (file)
@@ -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);
 }
 
index 7513965ea6ec2df61cb7e49095e6440514980866..1581cca47a05ca9feaf52d65f3dd349223ec8ebd 100644 (file)
@@ -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 };