From 3cdfb42cced175c108563f378589ec9aae134093 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 27 Sep 2021 17:46:38 +0200 Subject: [PATCH] Make rectangles have pointy corners This only makes a difference in HiDpi mode. Adaptation of the patch proposed by Daniel. Fix for bug #12336. --- src/frontends/qt/GuiPainter.cpp | 6 ++++-- src/frontends/qt/GuiPainter.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt/GuiPainter.cpp b/src/frontends/qt/GuiPainter.cpp index 75e9ace9e2..cf9cd7c118 100644 --- a/src/frontends/qt/GuiPainter.cpp +++ b/src/frontends/qt/GuiPainter.cpp @@ -57,7 +57,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; @@ -79,6 +79,8 @@ void GuiPainter::setQPainterPen(QColor const & col, pen.setWidth(lw); + pen.setJoinStyle(js); + setPen(pen); } @@ -210,7 +212,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/qt/GuiPainter.h b/src/frontends/qt/GuiPainter.h index f3b521bcc0..522b83c65f 100644 --- a/src/frontends/qt/GuiPainter.h +++ b/src/frontends/qt/GuiPainter.h @@ -185,7 +185,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 };