Skip to content

Commit

Permalink
fix(devtools): fix location double for all
Browse files Browse the repository at this point in the history
  • Loading branch information
lavnFan authored and zealotchen0 committed Jul 25, 2023
1 parent 388beef commit fb1be52
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions devtools/devtools-integration/native/src/devtools_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,10 @@ LayoutResult DevToolsUtil::GetLayoutOnScreen(const std::shared_ptr<DomNode>& roo
promise.set_value(result);
return;
}
auto xOnScreen = result_dom_object.find(kXOnScreen)->second.ToInt32Checked();
auto yOnScreen = result_dom_object.find(kYOnScreen)->second.ToInt32Checked();
auto width = result_dom_object.find(kViewWidth)->second.ToInt32Checked();
auto height = result_dom_object.find(kViewHeight)->second.ToInt32Checked();
result.left = static_cast<float>(xOnScreen);
result.top = static_cast<float>(yOnScreen);
result.width = static_cast<float>(width);
result.height = static_cast<float>(height);
result.left = static_cast<float>(result_dom_object.find(kXOnScreen)->second.ToDoubleChecked());
result.top = static_cast<float>(result_dom_object.find(kYOnScreen)->second.ToDoubleChecked());
result.width = static_cast<float>(result_dom_object.find(kViewWidth)->second.ToDoubleChecked());
result.height = static_cast<float>(result_dom_object.find(kViewHeight)->second.ToDoubleChecked());
promise.set_value(result);
});
find_node->CallFunction(kGetLocationOnScreen, argument, screen_shot_callback);
Expand Down

0 comments on commit fb1be52

Please sign in to comment.