Commit 3522f633 authored by oliver's avatar oliver

2007-04-08 Oliver Hunt <oliver@apple.com>

        Reviewed by Adam.

        Fix for <rdar://problem/5113621> REGRESSION: Dragging PDF as image does not give any feedback

        If we fail when attempting to create a drag image for a dragged
        image, we fall back to the appropriate icon.

        * page/DragController.cpp:
        (WebCore::DragController::doImageDrag):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20795 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e9b4cc74
2007-04-08 Oliver Hunt <oliver@apple.com>
Reviewed by Adam.
Fix for <rdar://problem/5113621> REGRESSION: Dragging PDF as image does not give any feedback
If we fail when attempting to create a drag image for a dragged
image, we fall back to the appropriate icon.
* page/DragController.cpp:
(WebCore::DragController::doImageDrag):
2007-04-08 Adam Roben <aroben@apple.com>
Reviewed by Oliver.
......@@ -646,18 +646,14 @@ void DragController::doImageDrag(Element* element, const IntPoint& dragOrigin, c
IntPoint origin;
Image* image = getImage(element);
if (image && image->size().height() * image->size().width() <= MaxOriginalImageArea) {
if (image && image->size().height() * image->size().width() <= MaxOriginalImageArea
&& (dragImage = createDragImageFromImage(image))) {
IntSize originalSize = rect.size();
origin = rect.location();
dragImage = createDragImageFromImage(image);
IntSize newSize;
if (dragImage) {
dragImage = fitDragImageToMaxSize(dragImage, maxDragImageSize());
dragImage = dissolveDragImageToFraction(dragImage, DragImageAlpha);
newSize = dragImageSize(dragImage);
}
dragImage = fitDragImageToMaxSize(dragImage, maxDragImageSize());
dragImage = dissolveDragImageToFraction(dragImage, DragImageAlpha);
IntSize newSize = dragImageSize(dragImage);
// Properly orient the drag image and orient it differently if it's smaller than the original
float scale = newSize.width() / (float)originalSize.width();
......
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