src/gui/painting/qstroker_p.h
changeset 30 5dc02b23752f
parent 18 2f34d5167611
--- a/src/gui/painting/qstroker_p.h	Wed Jun 23 19:07:03 2010 +0300
+++ b/src/gui/painting/qstroker_p.h	Tue Jul 06 15:10:48 2010 +0300
@@ -124,6 +124,9 @@
                                     qfixed ex, qfixed ey,
                                     void *data);
 
+// qtransform.cpp
+Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale);
+
 class Q_GUI_EXPORT QStrokerOps
 {
 public:
@@ -161,6 +164,16 @@
     QRectF clipRect() const { return m_clip_rect; }
     void setClipRect(const QRectF &clip) { m_clip_rect = clip; }
 
+    void setCurveThresholdFromTransform(const QTransform &transform)
+    {
+        qreal scale;
+        qt_scaleForTransform(transform, &scale);
+        setCurveThreshold(scale == 0 ? qreal(0.5) : (qreal(0.5) / scale));
+    }
+
+    void setCurveThreshold(qfixed threshold) { m_curveThreshold = threshold; }
+    qfixed curveThreshold() const { return m_curveThreshold; }
+
 protected:
     inline void emitMoveTo(qfixed x, qfixed y);
     inline void emitLineTo(qfixed x, qfixed y);
@@ -170,6 +183,7 @@
     QDataBuffer<Element> m_elements;
 
     QRectF m_clip_rect;
+    qfixed m_curveThreshold;
 
     void *m_customData;
     qStrokerMoveToHook m_moveTo;
@@ -208,9 +222,6 @@
     void setMiterLimit(qfixed length) { m_miterLimit = length; }
     qfixed miterLimit() const { return m_miterLimit; }
 
-    void setCurveThreshold(qfixed threshold) { m_curveThreshold = threshold; }
-    qfixed curveThreshold() const { return m_curveThreshold; }
-
     void joinPoints(qfixed x, qfixed y, const QLineF &nextLine, LineJoinMode join);
     inline void emitMoveTo(qfixed x, qfixed y);
     inline void emitLineTo(qfixed x, qfixed y);
@@ -227,7 +238,6 @@
 
     qfixed m_strokeWidth;
     qfixed m_miterLimit;
-    qfixed m_curveThreshold;
 
     LineJoinMode m_capStyle;
     LineJoinMode m_joinStyle;