void QQuickContext2D::reset()
{
QQuickContext2D::State newState;
- newState.matrix = QTransform();
m_path = QPainterPath();
newState.clipPath = defaultClipPath;
newState.clipPath.setFillRule(Qt::WindingFill);
- newState.strokeStyle = QColor("#000000");
- newState.fillStyle = QColor("#000000");
- newState.fillPatternRepeatX = false;
- newState.fillPatternRepeatY = false;
- newState.strokePatternRepeatX = false;
- newState.strokePatternRepeatY = false;
- newState.invertibleCTM = true;
- newState.fillRule = Qt::WindingFill;
- newState.globalAlpha = 1.0;
- newState.lineWidth = 1;
- newState.lineCap = Qt::FlatCap;
- newState.lineJoin = Qt::MiterJoin;
- newState.miterLimit = 10;
- newState.shadowOffsetX = 0;
- newState.shadowOffsetY = 0;
- newState.shadowBlur = 0;
- newState.shadowColor = qRgba(0, 0, 0, 0);
- newState.globalCompositeOperation = QPainter::CompositionMode_SourceOver;
- newState.font = QFont(QLatin1String("sans-serif"), 10);
- newState.textAlign = QQuickContext2D::Start;
- newState.textBaseline = QQuickContext2D::Alphabetic;
-
m_stateStack.clear();
m_stateStack.push(newState);
popState();
, shadowBlur(0)
, shadowColor(qRgba(0, 0, 0, 0))
, globalCompositeOperation(QPainter::CompositionMode_SourceOver)
- , font(QFont(QLatin1String("sans-serif"), 10))
+ , font(QFont(QLatin1String("sans-serif")))
, textAlign(QQuickContext2D::Start)
, textBaseline(QQuickContext2D::Alphabetic)
{
+ font.setPixelSize(10);
}
QTransform matrix;
compare(contextSpy.count, 1);
var ctx = canvas.getContext("2d");
+ compare(ctx.font, "sans-serif,-1,10,5,50,0,0,0,0,0");
+
ctx.font = "80.1px sans-serif";
compare(ctx.font, "sans-serif,-1,80,5,50,0,0,0,0,0");
}