53 #include "../vmisc/def.h"
55 #include <QGraphicsItem>
56 #include <QGraphicsScene>
57 #include <QGraphicsView>
70 if (not views.isEmpty())
72 scale = views.first()->transform().m11();
80 QColor
correctColor(
const QGraphicsItem *item,
const QColor &color)
84 if (item->isEnabled())
97 QRectF rec = QRectF(0, 0, radius*2, radius*2);
98 rec.translate(-rec.center().x(), -rec.center().y());
134 width = qMax(0.01, width/scale);
144 const qreal penWidthZero = qreal(0.00000001);
146 if (path == QPainterPath() || pen == Qt::NoPen)
150 QPainterPathStroker ps;
151 ps.setCapStyle(pen.capStyle());
152 if (pen.widthF() <= 0.0)
154 ps.setWidth(penWidthZero);
158 ps.setWidth(pen.widthF());
160 ps.setJoinStyle(pen.joinStyle());
161 ps.setMiterLimit(pen.miterLimit());
162 QPainterPath p = ps.createStroke(path);
const qreal widthMainLine
qreal sceneScale(QGraphicsScene *scene)
const qreal defPointRadiusPixel
QRectF PointRect(qreal radius)
void scaleCircleSize(QGraphicsEllipseItem *item, qreal scale)
QPainterPath ItemShapeFromPath(const QPainterPath &path, const QPen &pen)
qreal scaledRadius(qreal scale)
qreal scaleWidth(qreal width, qreal scale)
QColor correctColor(const QGraphicsItem *item, const QColor &color)
void scaleRectSize(QGraphicsRectItem *item, qreal scale)
const qreal widthHairLine