OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 23 matching lines...) Expand all Loading... |
34 * applicable instead of those above. If you wish to allow use of your | 34 * applicable instead of those above. If you wish to allow use of your |
35 * version of this file only under the terms of one of those two | 35 * version of this file only under the terms of one of those two |
36 * licenses (the MPL or the GPL) and not to allow others to use your | 36 * licenses (the MPL or the GPL) and not to allow others to use your |
37 * version of this file under the LGPL, indicate your decision by | 37 * version of this file under the LGPL, indicate your decision by |
38 * deletingthe provisions above and replace them with the notice and | 38 * deletingthe provisions above and replace them with the notice and |
39 * other provisions required by the MPL or the GPL, as the case may be. | 39 * other provisions required by the MPL or the GPL, as the case may be. |
40 * If you do not delete the provisions above, a recipient may use your | 40 * If you do not delete the provisions above, a recipient may use your |
41 * version of this file under any of the LGPL, the MPL or the GPL. | 41 * version of this file under any of the LGPL, the MPL or the GPL. |
42 */ | 42 */ |
43 | 43 |
44 #include "sky/engine/config.h" | |
45 #include "sky/engine/core/rendering/ScrollAlignment.h" | 44 #include "sky/engine/core/rendering/ScrollAlignment.h" |
46 | 45 |
47 #include "sky/engine/platform/geometry/LayoutRect.h" | 46 #include "sky/engine/platform/geometry/LayoutRect.h" |
48 | 47 |
49 namespace blink { | 48 namespace blink { |
50 | 49 |
51 const ScrollAlignment ScrollAlignment::alignCenterIfNeeded = { ScrollAlignmentNo
Scroll, ScrollAlignmentCenter, ScrollAlignmentClosestEdge }; | 50 const ScrollAlignment ScrollAlignment::alignCenterIfNeeded = { ScrollAlignmentNo
Scroll, ScrollAlignmentCenter, ScrollAlignmentClosestEdge }; |
52 const ScrollAlignment ScrollAlignment::alignToEdgeIfNeeded = { ScrollAlignmentNo
Scroll, ScrollAlignmentClosestEdge, ScrollAlignmentClosestEdge }; | 51 const ScrollAlignment ScrollAlignment::alignToEdgeIfNeeded = { ScrollAlignmentNo
Scroll, ScrollAlignmentClosestEdge, ScrollAlignmentClosestEdge }; |
53 const ScrollAlignment ScrollAlignment::alignCenterAlways = { ScrollAlignmentCent
er, ScrollAlignmentCenter, ScrollAlignmentCenter }; | 52 const ScrollAlignment ScrollAlignment::alignCenterAlways = { ScrollAlignmentCent
er, ScrollAlignmentCenter, ScrollAlignmentCenter }; |
54 const ScrollAlignment ScrollAlignment::alignTopAlways = { ScrollAlignmentTop, Sc
rollAlignmentTop, ScrollAlignmentTop }; | 53 const ScrollAlignment ScrollAlignment::alignTopAlways = { ScrollAlignmentTop, Sc
rollAlignmentTop, ScrollAlignmentTop }; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 y = exposeRect.maxY() - visibleRect.height(); | 135 y = exposeRect.maxY() - visibleRect.height(); |
137 else if (scrollY == ScrollAlignmentCenter) | 136 else if (scrollY == ScrollAlignmentCenter) |
138 y = exposeRect.y() + (exposeRect.height() - visibleRect.height()) / 2; | 137 y = exposeRect.y() + (exposeRect.height() - visibleRect.height()) / 2; |
139 else | 138 else |
140 y = exposeRect.y(); | 139 y = exposeRect.y(); |
141 | 140 |
142 return LayoutRect(LayoutPoint(x, y), visibleRect.size()); | 141 return LayoutRect(LayoutPoint(x, y), visibleRect.size()); |
143 } | 142 } |
144 | 143 |
145 }; // namespace blink | 144 }; // namespace blink |
OLD | NEW |