Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(540)

Unified Diff: sky/engine/core/events/MouseRelatedEvent.cpp

Issue 714013002: Remove some more zoom-related code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: merge to ToT Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/dom/TreeScope.cpp ('k') | sky/engine/core/frame/LocalFrame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/events/MouseRelatedEvent.cpp
diff --git a/sky/engine/core/events/MouseRelatedEvent.cpp b/sky/engine/core/events/MouseRelatedEvent.cpp
index d663994cfbf519fc8fd8f3e061a096b6f22c1b22..8387b04cfa7d2a391106e3cae692ae22a4d089a6 100644
--- a/sky/engine/core/events/MouseRelatedEvent.cpp
+++ b/sky/engine/core/events/MouseRelatedEvent.cpp
@@ -51,13 +51,8 @@ MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, bool canBubb
LocalFrame* frame = view() ? view()->frame() : 0;
if (frame && !isSimulated) {
- if (FrameView* frameView = frame->view()) {
+ if (FrameView* frameView = frame->view())
adjustedPageLocation = frameView->windowToContents(windowLocation);
- float scaleFactor = 1 / frame->pageZoomFactor();
- if (scaleFactor != 1.0f) {
- adjustedPageLocation.scale(scaleFactor, scaleFactor);
- }
- }
}
m_clientLocation = adjustedPageLocation;
@@ -92,21 +87,9 @@ void MouseRelatedEvent::initCoordinates(const LayoutPoint& clientLocation)
m_hasCachedRelativePosition = false;
}
-static float pageZoomFactor(const UIEvent* event)
-{
- LocalDOMWindow* window = event->view();
- if (!window)
- return 1;
- LocalFrame* frame = window->frame();
- if (!frame)
- return 1;
- return frame->pageZoomFactor();
-}
-
void MouseRelatedEvent::computePageLocation()
{
- float scaleFactor = pageZoomFactor(this);
- setAbsoluteLocation(roundedLayoutPoint(FloatPoint(pageX() * scaleFactor, pageY() * scaleFactor)));
+ setAbsoluteLocation(LayoutPoint(pageX(), pageY()));
}
void MouseRelatedEvent::receivedTarget()
@@ -131,9 +114,6 @@ void MouseRelatedEvent::computeRelativePosition()
if (RenderObject* r = targetNode->renderer()) {
FloatPoint localPos = r->absoluteToLocal(absoluteLocation(), UseTransforms);
m_offsetLocation = roundedLayoutPoint(localPos);
- float scaleFactor = 1 / pageZoomFactor(this);
- if (scaleFactor != 1.0f)
- m_offsetLocation.scale(scaleFactor, scaleFactor);
}
// Adjust layerLocation to be relative to the layer.
« no previous file with comments | « sky/engine/core/dom/TreeScope.cpp ('k') | sky/engine/core/frame/LocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698