From 7038b60e43a21c553163919059e8f581563872e7 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 22 Oct 2017 11:31:32 +0300 Subject: [PATCH] Fix black square bug. --HG-- branch : develop --- src/libs/vwidgets/scalesceneitems.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/vwidgets/scalesceneitems.cpp b/src/libs/vwidgets/scalesceneitems.cpp index c94e943d6..262e476fd 100644 --- a/src/libs/vwidgets/scalesceneitems.cpp +++ b/src/libs/vwidgets/scalesceneitems.cpp @@ -47,7 +47,9 @@ VScaledLine::VScaledLine(const QLineF &line, QGraphicsItem *parent) void VScaledLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { QPen lPen = pen(); - lPen.setWidthF(ScaleWidth(basicWidth, SceneScale(scene()))); + + const qreal width = ScaleWidth(basicWidth, SceneScale(scene())); + qRound(width) < 1 ? lPen.setWidthF(width) : lPen.setWidth(qRound(width)); setPen(lPen); QGraphicsLineItem::paint(painter, option, widget);