Commit f74b393e authored by andersca's avatar andersca

Reviewed by Oliver.

        Make DragController::maxDragImageSize a function to get rid of the global initializer.
        
        * page/DragController.cpp:
        (WebCore::DragController::doImageDrag):
        * page/DragController.h:
        * page/mac/DragControllerMac.mm:
        (WebCore::DragController::maxDragImageSize):
        * page/qt/DragControllerQt.cpp:
        (WebCore::DragController::maxDragImageSize):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7b6a8875
2007-02-19 Anders Carlsson <acarlsson@apple.com>
Reviewed by Oliver.
Make DragController::maxDragImageSize a function to get rid of the global initializer.
* page/DragController.cpp:
(WebCore::DragController::doImageDrag):
* page/DragController.h:
* page/mac/DragControllerMac.mm:
(WebCore::DragController::maxDragImageSize):
* page/qt/DragControllerQt.cpp:
(WebCore::DragController::maxDragImageSize):
2007-02-19 Darin Adler <darin@apple.com>
Reviewed by Hyatt.
......
......@@ -633,7 +633,7 @@ void DragController::doImageDrag(Element* element, const IntPoint& dragOrigin, c
IntSize newSize;
if (dragImage) {
dragImage = fitDragImageToMaxSize(dragImage, MaxDragImageSize);
dragImage = fitDragImageToMaxSize(dragImage, maxDragImageSize());
dragImage = dissolveDragImageToFraction(dragImage, DragImageAlpha);
newSize = dragImageSize(dragImage);
}
......
......@@ -82,9 +82,9 @@ namespace WebCore {
void dragEnded() { m_dragInitiator = 0; m_didInitiateDrag = false; }
bool startDrag(Frame* src, Clipboard*, DragOperation srcOp, const PlatformMouseEvent& dragEvent, const IntPoint& dragOrigin, bool isDHTMLDrag);
static const IntSize& maxDragImageSize();
static const int LinkDragBorderInset;
static const IntSize MaxDragImageSize;
static const int MaxOriginalImageArea;
static const int DragIconRightInset;
static const int DragIconBottomInset;
......
......@@ -35,7 +35,6 @@ namespace WebCore {
const int DragController::LinkDragBorderInset = -2;
const IntSize DragController::MaxDragImageSize(400, 400);
const int DragController::MaxOriginalImageArea = 1500 * 1500;
const int DragController::DragIconRightInset = 7;
const int DragController::DragIconBottomInset = 3;
......@@ -60,4 +59,11 @@ DragOperation DragController::dragOperation(DragData* dragData)
return DragOperationNone;
}
const IntSize& DragController::maxDragImageSize()
{
static const IntSize maxDragImageSize(400, 400);
return maxDragImageSize;
}
}
......@@ -37,7 +37,6 @@ namespace WebCore
// FIXME: These values are straight out of DragControllerMac, so probably have
// little correlation with Qt standards...
const int DragController::LinkDragBorderInset = 2;
const IntSize DragController::MaxDragImageSize(400, 400);
const int DragController::MaxOriginalImageArea = 1500 * 1500;
const int DragController::DragIconRightInset = 7;
const int DragController::DragIconBottomInset = 3;
......@@ -59,4 +58,11 @@ DragOperation DragController::dragOperation(DragData* dragData)
return DragOperationNone;
}
const IntSize& DragController::maxDragImageSize()
{
static const IntSize maxDragImageSize(400, 400);
return maxDragImageSize;
}
}
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