OLD | NEW |
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 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 3012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3023 } | 3023 } |
3024 } | 3024 } |
3025 | 3025 |
3026 void FrameView::setTopControlsViewportAdjustment(float adjustment) | 3026 void FrameView::setTopControlsViewportAdjustment(float adjustment) |
3027 { | 3027 { |
3028 m_topControlsViewportAdjustment = adjustment; | 3028 m_topControlsViewportAdjustment = adjustment; |
3029 } | 3029 } |
3030 | 3030 |
3031 IntPoint FrameView::maximumScrollPosition() const | 3031 IntPoint FrameView::maximumScrollPosition() const |
3032 { | 3032 { |
3033 FloatSize visibleContentSizeF = unscaledVisibleContentSize(ExcludeScrollbars
); | 3033 // Make the same calculation as in CC's LayerImpl::MaxScrollOffset() |
3034 visibleContentSizeF.expand(0, -m_topControlsViewportAdjustment); | 3034 FloatSize visibleSize = unscaledVisibleContentSize(ExcludeScrollbars); |
3035 visibleContentSizeF.scale(1 / visibleContentScaleFactor()); | 3035 visibleSize.expand(0, m_topControlsViewportAdjustment); |
3036 IntSize visibleSize = expandedIntSize(visibleContentSizeF); | |
3037 | 3036 |
3038 IntPoint maximumOffset( | 3037 FloatSize contentBounds = contentsSize(); |
3039 contentsWidth() - visibleSize.width() - scrollOrigin().x(), | 3038 contentBounds.scale(visibleContentScaleFactor()); |
3040 contentsHeight() - visibleSize.height() - scrollOrigin().y()); | 3039 contentBounds = flooredIntSize(contentBounds); |
3041 maximumOffset.clampNegativeToZero(); | 3040 |
3042 return maximumOffset; | 3041 FloatSize maximumOffset = contentBounds - visibleSize - toIntSize(scrollOrig
in()); |
| 3042 |
| 3043 // Convert back to CSS pixels. |
| 3044 maximumOffset.scale(1 / visibleContentScaleFactor()); |
| 3045 |
| 3046 IntPoint snappedMaximumOffset = flooredIntPoint(maximumOffset); |
| 3047 snappedMaximumOffset.clampNegativeToZero(); |
| 3048 return snappedMaximumOffset; |
3043 } | 3049 } |
3044 | 3050 |
3045 } // namespace blink | 3051 } // namespace blink |
OLD | NEW |