OSDN Git Service

require source rectangle argument for QSvgTinyDocument::mapSourceToTarget()
authorIvailo Monev <xakepa10@gmail.com>
Mon, 20 Sep 2021 03:01:15 +0000 (06:01 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Mon, 20 Sep 2021 03:01:15 +0000 (06:01 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/svg/qsvgtinydocument.cpp
src/svg/qsvgtinydocument_p.h

index 62373ac..88ebcf1 100644 (file)
@@ -206,7 +206,7 @@ void QSvgTinyDocument::draw(QPainter *p, const QRectF &bounds)
     p->save();
     //sets default style on the painter
     //### not the most optimal way
-    mapSourceToTarget(p, bounds);
+    mapSourceToTarget(p, bounds, QRectF());
     QPen pen(Qt::NoBrush, 1, Qt::SolidLine, Qt::FlatCap, Qt::SvgMiterJoin);
     pen.setMiterLimit(4);
     p->setPen(pen);
@@ -242,9 +242,7 @@ void QSvgTinyDocument::draw(QPainter *p, const QString &id,
 
     p->save();
 
-    const QRectF elementBounds = node->transformedBounds();
-
-    mapSourceToTarget(p, bounds, elementBounds);
+    mapSourceToTarget(p, bounds, node->transformedBounds());
     QTransform originalTransform = p->worldTransform();
 
     //XXX set default style on the painter
index 82dcce4..1ef6a18 100644 (file)
@@ -96,7 +96,7 @@ public:
     void setCurrentFrame(int);
     void setFramesPerSecond(int num);
 private:
-    void mapSourceToTarget(QPainter *p, const QRectF &targetRect, const QRectF &sourceRect = QRectF());
+    void mapSourceToTarget(QPainter *p, const QRectF &targetRect, const QRectF &sourceRect);
 
     QSize  m_size;