Fix incorrect scaling of drag regions on HiDPI display.

This commit is contained in:
Marshall Greenblatt 2016-08-08 16:15:20 +03:00
parent 8a68967937
commit ea33255c09
1 changed files with 2 additions and 0 deletions

View File

@ -500,12 +500,14 @@ void CefBrowserImpl::FocusedNodeChanged(const blink::WebNode& node) {
}
}
// Based on ExtensionHelper::DraggableRegionsChanged.
void CefBrowserImpl::DraggableRegionsChanged(blink::WebFrame* frame) {
blink::WebVector<blink::WebDraggableRegion> webregions =
frame->document().draggableRegions();
std::vector<Cef_DraggableRegion_Params> regions;
for (size_t i = 0; i < webregions.size(); ++i) {
Cef_DraggableRegion_Params region;
render_view()->ConvertViewportToWindowViaWidget(&webregions[i].bounds);
region.bounds = webregions[i].bounds;
region.draggable = webregions[i].draggable;
regions.push_back(region);