Skip to content

Commit

Permalink
Removed references to NonCosmeticDefaultPen
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Oct 15, 2023
1 parent 708b1b2 commit e6852ff
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions qwt/graphic.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,26 @@
"""

import math
from qwt.null_paintdevice import QwtNullPaintDevice
from qwt.painter_command import QwtPainterCommand

from qtpy.QtCore import QPointF, QRect, QRectF, QSize, QSizeF, Qt
from qtpy.QtGui import (
QImage,
QPaintEngine,
QPainter,
QPainterPathStroker,
QPaintEngine,
QPixmap,
QTransform,
QImage,
)
from qtpy.QtCore import Qt, QRectF, QSizeF, QSize, QPointF, QRect

from qwt.null_paintdevice import QwtNullPaintDevice
from qwt.painter_command import QwtPainterCommand


def qwtHasScalablePen(painter):
pen = painter.pen()
scalablePen = False
if pen.style() != Qt.NoPen and pen.brush().style() != Qt.NoBrush:
scalablePen = not pen.isCosmetic()
if not scalablePen and pen.widthF() == 0.0:
hints = painter.renderHints()
if hints & QPainter.NonCosmeticDefaultPen:
scalablePen = True
return scalablePen


Expand Down Expand Up @@ -65,10 +62,6 @@ def qwtExecCommand(painter, cmd, renderHints, transform, initialTransform):
and painter.transform().isScaling()
):
isCosmetic = painter.pen().isCosmetic()
if isCosmetic and painter.pen().widthF() == 0.0:
hints = painter.renderHints()
if hints & QPainter.NonCosmeticDefaultPen:
isCosmetic = False
doMap = not isCosmetic
if doMap:
tr = painter.transform()
Expand Down

0 comments on commit e6852ff

Please sign in to comment.