|
|
@@ -65,15 +65,18 @@ void InputSourceTouch::handleEventFingerMotion(const SDL_TouchFingerEvent & tfin
|
|
|
if(std::abs(motionAccumulatedX[tfinger.fingerId]) < motionThreshold && std::abs(motionAccumulatedY[tfinger.fingerId]) < motionThreshold)
|
|
|
return;
|
|
|
|
|
|
+ int scalingFactor = ENGINE->screenHandler().getScalingFactor();
|
|
|
+
|
|
|
if (settings["video"]["cursor"].String() == "software" && state != TouchState::RELATIVE_MODE)
|
|
|
- ENGINE->cursor().cursorMove(ENGINE->getCursorPosition().x, ENGINE->getCursorPosition().y);
|
|
|
+ {
|
|
|
+ Point cursorPosition = Point(tfinger.x * screenSize.x, tfinger.y * screenSize.y) * scalingFactor;
|
|
|
+ ENGINE->cursor().cursorMove(cursorPosition.x, cursorPosition.y);
|
|
|
+ }
|
|
|
|
|
|
switch(state)
|
|
|
{
|
|
|
case TouchState::RELATIVE_MODE:
|
|
|
{
|
|
|
- int scalingFactor = ENGINE->screenHandler().getScalingFactor();
|
|
|
-
|
|
|
Point moveDistance {
|
|
|
static_cast<int>(screenSize.x * params.relativeModeSpeedFactor * motionAccumulatedX[tfinger.fingerId]),
|
|
|
static_cast<int>(screenSize.y * params.relativeModeSpeedFactor * motionAccumulatedY[tfinger.fingerId])
|
|
|
@@ -134,6 +137,14 @@ void InputSourceTouch::handleEventFingerDown(const SDL_TouchFingerEvent & tfinge
|
|
|
|
|
|
lastTapTimeTicks = tfinger.timestamp;
|
|
|
|
|
|
+ if (settings["video"]["cursor"].String() == "software" && state != TouchState::RELATIVE_MODE)
|
|
|
+ {
|
|
|
+ int scalingFactor = ENGINE->screenHandler().getScalingFactor();
|
|
|
+ Point screenSize = ENGINE->screenDimensions();
|
|
|
+ Point cursorPosition = Point(tfinger.x * screenSize.x, tfinger.y * screenSize.y) * scalingFactor;
|
|
|
+ ENGINE->cursor().cursorMove(cursorPosition.x, cursorPosition.y);
|
|
|
+ }
|
|
|
+
|
|
|
switch(state)
|
|
|
{
|
|
|
case TouchState::RELATIVE_MODE:
|