mirror of
https://github.com/Rafostar/clapper.git
synced 2025-09-01 00:41:58 +02:00
Improve obtaining initial player dragging coords
This commit is contained in:
@@ -560,15 +560,24 @@ class ClapperPlayer extends PlayerBase
|
|||||||
let [isActive, startX, startY] = gesture.get_start_point();
|
let [isActive, startX, startY] = gesture.get_start_point();
|
||||||
if(!isActive) return;
|
if(!isActive) return;
|
||||||
|
|
||||||
let root = this.widget.get_root();
|
let native = this.widget.get_native();
|
||||||
if(!root) return;
|
if(!native) return;
|
||||||
|
|
||||||
|
let [isShared, winX, winY] = this.widget.translate_coordinates(
|
||||||
|
native, startX, startY
|
||||||
|
);
|
||||||
|
if(!isShared) return;
|
||||||
|
|
||||||
|
let [nativeX, nativeY] = native.get_surface_transform();
|
||||||
|
winX += nativeX;
|
||||||
|
winY += nativeY;
|
||||||
|
|
||||||
this.isWidgetDragging = true;
|
this.isWidgetDragging = true;
|
||||||
root.get_surface().begin_move(
|
native.get_surface().begin_move(
|
||||||
gesture.get_device(),
|
gesture.get_device(),
|
||||||
gesture.get_current_button(),
|
gesture.get_current_button(),
|
||||||
startX,
|
winX,
|
||||||
startY,
|
winY,
|
||||||
gesture.get_current_event_time()
|
gesture.get_current_event_time()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user