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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Fix README.md Created 4 years, 2 months 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
9 * rights reserved. 9 * rights reserved.
10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 // WG clarification. 630 // WG clarification.
631 if (document->isSVGDocument()) { 631 if (document->isSVGDocument()) {
632 if (!document->accessSVGExtensions().zoomAndPanEnabled()) 632 if (!document->accessSVGExtensions().zoomAndPanEnabled())
633 return; 633 return;
634 } 634 }
635 635
636 if (m_pageZoomFactor != pageZoomFactor) { 636 if (m_pageZoomFactor != pageZoomFactor) {
637 if (FrameView* view = this->view()) { 637 if (FrameView* view = this->view()) {
638 // Update the scroll position when doing a full page zoom, so the content 638 // Update the scroll position when doing a full page zoom, so the content
639 // stays in relatively the same position. 639 // stays in relatively the same position.
640 LayoutPoint scrollPosition = view->scrollPosition(); 640 ScrollOffset scrollOffset = view->scrollOffset();
641 float percentDifference = (pageZoomFactor / m_pageZoomFactor); 641 float percentDifference = (pageZoomFactor / m_pageZoomFactor);
642 view->setScrollPosition( 642 view->setScrollOffset(
643 DoublePoint(scrollPosition.x() * percentDifference, 643 ScrollOffset(scrollOffset.width() * percentDifference,
644 scrollPosition.y() * percentDifference), 644 scrollOffset.height() * percentDifference),
645 ProgrammaticScroll); 645 ProgrammaticScroll);
646 } 646 }
647 } 647 }
648 648
649 m_pageZoomFactor = pageZoomFactor; 649 m_pageZoomFactor = pageZoomFactor;
650 m_textZoomFactor = textZoomFactor; 650 m_textZoomFactor = textZoomFactor;
651 651
652 for (Frame* child = tree().firstChild(); child; 652 for (Frame* child = tree().firstChild(); child;
653 child = child->tree().nextSibling()) { 653 child = child->tree().nextSibling()) {
654 if (child->isLocalFrame()) 654 if (child->isLocalFrame())
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 898 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
899 m_frame->client()->frameBlameContext()->Enter(); 899 m_frame->client()->frameBlameContext()->Enter();
900 } 900 }
901 901
902 ScopedFrameBlamer::~ScopedFrameBlamer() { 902 ScopedFrameBlamer::~ScopedFrameBlamer() {
903 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 903 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
904 m_frame->client()->frameBlameContext()->Leave(); 904 m_frame->client()->frameBlameContext()->Leave();
905 } 905 }
906 906
907 } // namespace blink 907 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp ('k') | third_party/WebKit/Source/core/frame/RootFrameViewport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698