File indexing completed on 2025-02-02 04:54:38

0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 // SPDX-FileCopyrightText: 2018 Kevin Ottens <ervin@kde.org>
0003 
0004 /*
0005  * Adapted by Louis Schul <schul9louis@gmail.com>
0006  * in 2023 for Klevernotes
0007  */
0008 
0009 #include "pointMaker.h"
0010 
0011 #include <QTabletEvent>
0012 
0013 Event TabletEvent::create(QTabletEvent *event)
0014 {
0015     const QPointF eventPos = event->position();
0016     Event point;
0017     point.x = static_cast<float>(eventPos.x());
0018     point.y = static_cast<float>(eventPos.y());
0019     point.pressure = static_cast<float>(event->pressure());
0020 
0021     return point;
0022 }
0023 
0024 Event MouseEvent::create(const float x, const float y)
0025 {
0026     Event point;
0027     point.x = x;
0028     point.y = y;
0029     point.pressure = static_cast<float>(0.5f);
0030 
0031     return point;
0032 }