Unreviewed. Unnecessary explicit initialization of LayoutUnit from r167985.
authorroger_fong@apple.com <roger_fong@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Apr 2014 22:10:06 +0000 (22:10 +0000)
committerroger_fong@apple.com <roger_fong@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Apr 2014 22:10:06 +0000 (22:10 +0000)
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::determinePrimarySnapshottedPlugIn):
Darin points out that I can just use “/2” instead of “/LayoutUnit(2.0)”.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168050 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 389db93..3fc87f8 100644 (file)
@@ -1,3 +1,11 @@
+2014-04-30  Roger Fong  <roger_fong@apple.com>
+
+        Unreviewed. Unnecessary explicit initialization of LayoutUnit from r167985.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
+        Darin points out that I can just use “/2” instead of “/LayoutUnit(2.0)”.
+
 2014-04-30 David Hyatt  <hyatt@apple.com>
 
         [New Multicolumn] Enable new multi-column mode
index 195d549..ff96b6f 100644 (file)
@@ -4396,8 +4396,8 @@ void WebPage::determinePrimarySnapshottedPlugIn()
             IntRect elementRectRelativeToView = element->clientRect();
             IntRect elementRectRelativeToTopDocument(elementRectRelativeToView.location() + scrollOffset, elementRectRelativeToView.size());
             LayoutRect inflatedPluginRect = plugInRectRelativeToTopDocument;
-            LayoutUnit xOffset = (inflatedPluginRect.width() * overlappingImageBoundsScale - inflatedPluginRect.width()) / LayoutUnit(2.0);
-            LayoutUnit yOffset = (inflatedPluginRect.height() * overlappingImageBoundsScale - inflatedPluginRect.height()) / LayoutUnit(2.0);
+            LayoutUnit xOffset = (inflatedPluginRect.width() * overlappingImageBoundsScale - inflatedPluginRect.width()) / 2;
+            LayoutUnit yOffset = (inflatedPluginRect.height() * overlappingImageBoundsScale - inflatedPluginRect.height()) / 2;
             inflatedPluginRect.inflateX(xOffset);
             inflatedPluginRect.inflateY(yOffset);