From 90574160db2d4e51fa6d8480a0a084e69ac72815 Mon Sep 17 00:00:00 2001 From: Tony Ganch Date: Tue, 20 Jun 2017 20:23:11 +0200 Subject: [PATCH] Replace x/y in WebMouseEvent with proper getters/setters --- .../native_mate_converters/blink_converter.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/atom/common/native_mate_converters/blink_converter.cc b/atom/common/native_mate_converters/blink_converter.cc index b24b28eb98..8aff33481a 100644 --- a/atom/common/native_mate_converters/blink_converter.cc +++ b/atom/common/native_mate_converters/blink_converter.cc @@ -247,12 +247,22 @@ bool Converter::FromV8( return false; if (!ConvertFromV8(isolate, val, static_cast(out))) return false; - if (!dict.Get("x", &out->x) || !dict.Get("y", &out->y)) + + float x = 0.f; + float y = 0.f; + if (!dict.Get("x", &x) || !dict.Get("y", &y)) return false; + out->SetPositionInWidget(x, y); + if (!dict.Get("button", &out->button)) out->button = blink::WebMouseEvent::Button::kLeft; - dict.Get("globalX", &out->globalX); - dict.Get("globalY", &out->globalY); + + float global_x = 0.f; + float global_y = 0.f; + dict.Get("globalX", &global_x); + dict.Get("globalY", &global_y); + out->SetPositionInScreen(global_x, global_y); + dict.Get("movementX", &out->movement_x); dict.Get("movementY", &out->movement_y); dict.Get("clickCount", &out->click_count);