summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2010-09-10 00:35:51 +0200
committerJens Bache-Wiig <jbache@trolltech.com>2010-09-16 21:09:02 +0200
commit0664730693381ac05fa96e0f2604e726dc5e1bb3 (patch)
tree3363270008d2c59b9ed179b2e5d8e05666fc7334
parent0195213139888a048099370430568fc0b2224243 (diff)
Add support for setting the color property
-rw-r--r--src/canvas.cpp3
-rw-r--r--src/canvas.h2
-rw-r--r--src/context2d.cpp1
3 files changed, 4 insertions, 2 deletions
diff --git a/src/canvas.cpp b/src/canvas.cpp
index 2aecc29..5fe8408 100644
--- a/src/canvas.cpp
+++ b/src/canvas.cpp
@@ -166,7 +166,7 @@ void Canvas::requestPaint()
void Canvas::geometryChanged(const QRectF &newGeometry, const QRectF &)
{
if (m_canvasWidth == 0 && m_canvasHeight == 0
- && newGeometry.width() > 0 && newGeometry.height() > 0) {
+ && newGeometry.width() > 0 && newGeometry.height() > 0) {
m_context->setSize(width(), height());
}
}
@@ -243,3 +243,4 @@ void Canvas::clearInterval(const QScriptValue &handler)
{
CanvasTimer::removeTimer(handler);
}
+
diff --git a/src/canvas.h b/src/canvas.h
index 3c35c9c..7f5c286 100644
--- a/src/canvas.h
+++ b/src/canvas.h
@@ -88,6 +88,8 @@ public Q_SLOTS:
void clearInterval(const QScriptValue &handler);
void clearTimeout(const QScriptValue &handler);
+ bool save(const QString& filename) const;
+
Q_SIGNALS:
void fillModeChanged();
void canvasWidthChanged();
diff --git a/src/context2d.cpp b/src/context2d.cpp
index d8ca576..3f1c2ef 100644
--- a/src/context2d.cpp
+++ b/src/context2d.cpp
@@ -480,7 +480,6 @@ void Context2D::clearRect(qreal x, qreal y, qreal w, qreal h)
m_painter.setMatrix(m_state.matrix, false);
m_painter.setCompositionMode(QPainter::CompositionMode_Source);
QColor fillColor = parent()->property("color").value<QColor>();
-
m_painter.fillRect(QRectF(x, y, w, h), fillColor);
m_painter.restore();
scheduleChange();