diff --git a/lib/src/webview.dart b/lib/src/webview.dart index 8b10ad9..a86b392 100644 --- a/lib/src/webview.dart +++ b/lib/src/webview.dart @@ -85,7 +85,7 @@ class WebViewController extends ValueNotifier { } assert(value); return _pluginChannel - .invokeMethod('cursorMove', [position.dx, position.dy]); + .invokeMethod('cursorMove', [position.dx.round(), position.dy.round()]); } Future _cursorDragging(Offset position) async { @@ -94,7 +94,7 @@ class WebViewController extends ValueNotifier { } assert(value); return _pluginChannel - .invokeMethod('cursorDragging', [position.dx, position.dy]); + .invokeMethod('cursorDragging', [position.dx.round(), position.dy.round()]); } Future _cursorClickDown(Offset position) async { diff --git a/windows/webview_cef_plugin.cpp b/windows/webview_cef_plugin.cpp index 68f74c6..792e89b 100644 --- a/windows/webview_cef_plugin.cpp +++ b/windows/webview_cef_plugin.cpp @@ -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(method_call.arguments());