diff options
author | Alexander Volkov <a.volkov@rusbitech.ru> | 2015-05-14 18:45:33 +0300 |
---|---|---|
committer | Alexander Volkov <a.volkov@rusbitech.ru> | 2015-05-23 11:28:00 +0000 |
commit | 431e5d9f47515b51dfde582f28ea6bfed5bf82dd (patch) | |
tree | 5adfd60c5195d2390218501c7a39d76da58f373d | |
parent | 0c85cdb8c2601981ce313f262f7d6db951bf61ac (diff) |
fingerpaint example: Use the maximum diameter for the touch spot by default
The result doesn't look good when you paint with the MinimumDiameter (3 px).
Also don't paint released touch points, because we can't get neither the
touch rect not the pressure for them.
Change-Id: I8d17c4884ae41545b2cd3f208afa73262133456c
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r-- | examples/touch/fingerpaint/scribblearea.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/touch/fingerpaint/scribblearea.cpp b/examples/touch/fingerpaint/scribblearea.cpp index 469c6b1a70..05598c134c 100644 --- a/examples/touch/fingerpaint/scribblearea.cpp +++ b/examples/touch/fingerpaint/scribblearea.cpp @@ -187,13 +187,14 @@ bool ScribbleArea::event(QEvent *event) foreach (const QTouchEvent::TouchPoint &touchPoint, touchPoints) { switch (touchPoint.state()) { case Qt::TouchPointStationary: - // don't do anything if this touch point hasn't moved + case Qt::TouchPointReleased: + // don't do anything if this touch point hasn't moved or has been released continue; default: { QRectF rect = touchPoint.rect(); if (rect.isEmpty()) { - qreal diameter = MinimumDiameter; + qreal diameter = MaximumDiameter; if (touch->device()->capabilities() & QTouchDevice::Pressure) diameter = MinimumDiameter + (MaximumDiameter - MinimumDiameter) * touchPoint.pressure(); rect.setSize(QSizeF(diameter, diameter)); |