diff options
Diffstat (limited to 'examples/multitouch/fingerpaint/scribblearea.cpp')
-rw-r--r-- | examples/multitouch/fingerpaint/scribblearea.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/multitouch/fingerpaint/scribblearea.cpp b/examples/multitouch/fingerpaint/scribblearea.cpp index a042fe7..ffff9bb 100644 --- a/examples/multitouch/fingerpaint/scribblearea.cpp +++ b/examples/multitouch/fingerpaint/scribblearea.cpp @@ -184,8 +184,12 @@ bool ScribbleArea::event(QEvent *event) continue; default: { - int diameter = int(50 * touchPoint->pressure()); - QRectF rectF(0, 0, diameter, diameter); + QSizeF area = touchPoint->area(); + if (area.isEmpty()) { + qreal diameter = qreal(50) * touchPoint->pressure(); + area = QSizeF(diameter, diameter); + } + QRectF rectF(QPointF(), area); rectF.moveCenter(touchPoint->pos()); QRect rect = rectF.toRect(); |