mirror of
https://github.com/chenasraf/webview_cef.git
synced 2026-05-18 01:49:03 +00:00
[windows] mouse move & drag drop support
This commit is contained in:
@@ -85,7 +85,7 @@ class WebViewController extends ValueNotifier<bool> {
|
||||
}
|
||||
assert(value);
|
||||
return _pluginChannel
|
||||
.invokeMethod('cursorMove', [position.dx, position.dy]);
|
||||
.invokeMethod('cursorMove', [position.dx.round(), position.dy.round()]);
|
||||
}
|
||||
|
||||
Future<void> _cursorDragging(Offset position) async {
|
||||
@@ -94,7 +94,7 @@ class WebViewController extends ValueNotifier<bool> {
|
||||
}
|
||||
assert(value);
|
||||
return _pluginChannel
|
||||
.invokeMethod('cursorDragging', [position.dx, position.dy]);
|
||||
.invokeMethod('cursorDragging', [position.dx.round(), position.dy.round()]);
|
||||
}
|
||||
|
||||
Future<void> _cursorClickDown(Offset position) async {
|
||||
|
||||
@@ -195,6 +195,16 @@ namespace webview_cef {
|
||||
handler.get()->cursorClick(point->first, point->second, true);
|
||||
result->Success();
|
||||
}
|
||||
else if (method_call.method_name().compare("cursorMove") == 0) {
|
||||
const auto point = GetPointFromArgs(method_call.arguments());
|
||||
handler.get()->cursorMove(point->first, point->second, false);
|
||||
result->Success();
|
||||
}
|
||||
else if (method_call.method_name().compare("cursorDragging") == 0) {
|
||||
const auto point = GetPointFromArgs(method_call.arguments());
|
||||
handler.get()->cursorMove(point->first, point->second, true);
|
||||
result->Success();
|
||||
}
|
||||
else if (method_call.method_name().compare("setScrollDelta") == 0) {
|
||||
const flutter::EncodableList* list =
|
||||
std::get_if<flutter::EncodableList>(method_call.arguments());
|
||||
|
||||
Reference in New Issue
Block a user