[Interest] Mapping floating point screen coordinates to QGraphicsScene

Patrick Stinson patrickkidd at gmail.com
Sun Mar 19 05:46:28 CET 2017


That’s correct, the floating point values are either 0 or .5.

I am digging into this because a) it’s offered so why not use it, and b) because I am seeing a little jitter in my pencil drawing and trying to eliminate all causes for error.

> On Mar 18, 2017, at 8:56 PM, Ch'Gans <chgans at gna.org> wrote:
> 
> On 19 March 2017 at 15:59, Patrick Stinson <patrickkidd at gmail.com> wrote:
>> UITouch coordinates are floating point on iOS, for example for the Apple Pencil. Is there a way to map this? Seems like this would be easy to implement based on the QPoint version…
>> 
> 
> In which coordinate system are the UITouch points expressed in? Seems
> odd to use floating point for a pixel based CS, unless half pixels
> exist (high res display?)
> 
> Chris
> 
>> // pks: apple pencil
>> QPointF QGraphicsView::mapToScene(const QPointF &point) const
>> {
>>    Q_D(const QGraphicsView);
>>    QPointF p = point;
>>    p.rx() += d->horizontalScroll();
>>    p.ry() += d->verticalScroll();
>>    return d->identityMatrix ? p : d->matrix.inverted().map(p);
>> }
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list