Title: [87878] trunk/Source/WebCore
Revision
87878
Author
[email protected]
Date
2011-06-01 21:51:08 -0700 (Wed, 01 Jun 2011)

Log Message

2011-06-01  Levi Weintraub  <[email protected]>

        Reviewed by Hajime Morita.

        Add IntPoint + IntPoint operator
        https://bugs.webkit.org/show_bug.cgi?id=61876

        Adding an operator+ convenience method to IntPoint that sums two points
        and returns the result as an IntPoint. Changing doImageDrag to use it
        as a proof of concept.

        No new tests since there is no change in behavior.

        * page/DragController.cpp:
        (WebCore::DragController::doImageDrag):
        * platform/graphics/IntPoint.h:
        (WebCore::operator+):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (87877 => 87878)


--- trunk/Source/WebCore/ChangeLog	2011-06-02 04:21:26 UTC (rev 87877)
+++ trunk/Source/WebCore/ChangeLog	2011-06-02 04:51:08 UTC (rev 87878)
@@ -1,3 +1,21 @@
+2011-06-01  Levi Weintraub  <[email protected]>
+
+        Reviewed by Hajime Morita.
+
+        Add IntPoint + IntPoint operator
+        https://bugs.webkit.org/show_bug.cgi?id=61876
+
+        Adding an operator+ convenience method to IntPoint that sums two points
+        and returns the result as an IntPoint. Changing doImageDrag to use it
+        as a proof of concept.
+
+        No new tests since there is no change in behavior.
+
+        * page/DragController.cpp:
+        (WebCore::DragController::doImageDrag):
+        * platform/graphics/IntPoint.h:
+        (WebCore::operator+):
+
 2011-06-01  Jaehun Lim  <[email protected]>
 
         Reviewed by Eric Seidel.

Modified: trunk/Source/WebCore/page/DragController.cpp (87877 => 87878)


--- trunk/Source/WebCore/page/DragController.cpp	2011-06-02 04:21:26 UTC (rev 87877)
+++ trunk/Source/WebCore/page/DragController.cpp	2011-06-02 04:51:08 UTC (rev 87878)
@@ -825,8 +825,7 @@
             origin = IntPoint(DragIconRightInset - dragImageSize(dragImage).width(), DragIconBottomInset);
     }
 
-    dragImageOffset.setX(mouseDownPoint.x() + origin.x());
-    dragImageOffset.setY(mouseDownPoint.y() + origin.y());
+    dragImageOffset = mouseDownPoint + origin;
     doSystemDrag(dragImage, dragImageOffset, dragOrigin, clipboard, frame, false);
 
     deleteDragImage(dragImage);

Modified: trunk/Source/WebCore/platform/graphics/IntPoint.h (87877 => 87878)


--- trunk/Source/WebCore/platform/graphics/IntPoint.h	2011-06-02 04:21:26 UTC (rev 87877)
+++ trunk/Source/WebCore/platform/graphics/IntPoint.h	2011-06-02 04:51:08 UTC (rev 87878)
@@ -187,6 +187,11 @@
     return IntPoint(a.x() + b.width(), a.y() + b.height());
 }
 
+inline IntPoint operator+(const IntPoint& a, const IntPoint& b)
+{
+    return IntPoint(a.x() + b.x(), a.y() + b.y());
+}
+
 inline IntSize operator-(const IntPoint& a, const IntPoint& b)
 {
     return IntSize(a.x() - b.x(), a.y() - b.y());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to