Changeset 72495 in webkit


Ignore:
Timestamp:
Nov 20, 2010 10:44:29 PM (13 years ago)
Author:
andreas.kling@nokia.com
Message:

2010-11-20 Andreas Kling <kling@webkit.org>

Reviewed by Antonio Gomes.

[Qt] Limit the size of image preview "cursor" when dragging
https://bugs.webkit.org/show_bug.cgi?id=49872

Respect DragController::maxDragImageSize() (currently 400x400.)

  • platform/qt/DragImageQt.cpp: (WebCore::dragImageSize): (WebCore::scaleDragImage):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r72494 r72495  
     12010-11-20  Andreas Kling  <kling@webkit.org>
     2
     3        Reviewed by Antonio Gomes.
     4
     5        [Qt] Limit the size of image preview "cursor" when dragging
     6        https://bugs.webkit.org/show_bug.cgi?id=49872
     7
     8        Respect DragController::maxDragImageSize() (currently 400x400.)
     9
     10        * platform/qt/DragImageQt.cpp:
     11        (WebCore::dragImageSize):
     12        (WebCore::scaleDragImage):
     13
    1142010-11-20  Andreas Kling  <kling@webkit.org>
    215
  • trunk/WebCore/platform/qt/DragImageQt.cpp

    r72494 r72495  
    3232namespace WebCore {
    3333
    34 IntSize dragImageSize(DragImageRef)
     34IntSize dragImageSize(DragImageRef image)
    3535{
    36     return IntSize(0, 0);
     36    if (!image)
     37        return IntSize();
     38
     39    return image->size();
    3740}
    3841
     
    4245}
    4346
    44 DragImageRef scaleDragImage(DragImageRef image, FloatSize)
     47DragImageRef scaleDragImage(DragImageRef image, FloatSize scale)
    4548{
     49    if (!image)
     50        return 0;
     51
     52    int scaledWidth = image->width() * scale.width();
     53    int scaledHeight = image->height() * scale.height();
     54
     55    *image = image->scaled(scaledWidth, scaledHeight);
    4656    return image;
    4757}
Note: See TracChangeset for help on using the changeset viewer.