Commit d9b5c831 authored by Alex Danilo's avatar Alex Danilo Committed by Commit Bot

Position drag image above touch drag

Dragging files using mouse positions the drag image origin at the
location of the mouse, i.e. the image extends to the right and down. In
the case whem the drag is initiated from touch, the drag image is
obscured.

Check for touch initiated drag and position the image above the touch
position.

Bug: 755703
Change-Id: I313f245bacb4c0e649cae5597653bcdad4fd1130
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1943071Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Alex Danilo <adanilo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720121}
parent 572fe932
...@@ -749,7 +749,13 @@ class FileTransferController { ...@@ -749,7 +749,13 @@ class FileTransferController {
} }
const dragThumbnail = this.renderThumbnail_(); const dragThumbnail = this.renderThumbnail_();
dt.setDragImage(dragThumbnail, 0, 0); let yOffset = 0;
// Position the drag image above the start point for touch intiated drag.
if (this.touching_) {
const thumbNailExtent = dragThumbnail.getBoundingClientRect();
yOffset = thumbNailExtent.height;
}
dt.setDragImage(dragThumbnail, 0, yOffset);
window[DRAG_AND_DROP_GLOBAL_DATA] = { window[DRAG_AND_DROP_GLOBAL_DATA] = {
sourceRootURL: dt.getData('fs/sourceRootURL'), sourceRootURL: dt.getData('fs/sourceRootURL'),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment