OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 result.append(LineSegment(x1, x2)); | 156 result.append(LineSegment(x1, x2)); |
157 } | 157 } |
158 | 158 |
159 static FloatPoint cornerInterceptForWidth(float width, float widthAtIntercept, f
loat rx, float ry) | 159 static FloatPoint cornerInterceptForWidth(float width, float widthAtIntercept, f
loat rx, float ry) |
160 { | 160 { |
161 float xi = (width - widthAtIntercept) / 2; | 161 float xi = (width - widthAtIntercept) / 2; |
162 float yi = ry - ellipseYIntercept(rx - xi, rx, ry); | 162 float yi = ry - ellipseYIntercept(rx - xi, rx, ry); |
163 return FloatPoint(xi, yi); | 163 return FloatPoint(xi, yi); |
164 } | 164 } |
165 | 165 |
166 bool RectangleShape::firstIncludedIntervalLogicalTop(LayoutUnit minLogicalInterv
alTop, const LayoutSize& minLogicalIntervalSize, LayoutUnit& result) const | 166 bool RectangleShape::firstIncludedIntervalLogicalTop(LayoutUnit minLogicalInterv
alTop, const FloatSize& minLogicalIntervalSize, LayoutUnit& result) const |
167 { | 167 { |
168 float minIntervalTop = minLogicalIntervalTop; | 168 float minIntervalTop = minLogicalIntervalTop; |
169 float minIntervalHeight = minLogicalIntervalSize.height(); | 169 float minIntervalHeight = minLogicalIntervalSize.height(); |
170 float minIntervalWidth = minLogicalIntervalSize.width(); | 170 float minIntervalWidth = minLogicalIntervalSize.width(); |
171 | 171 |
172 const FloatRect& bounds = shapePaddingBounds(); | 172 const FloatRect& bounds = shapePaddingBounds(); |
173 if (bounds.isEmpty() || minIntervalWidth > bounds.width()) | 173 if (bounds.isEmpty() || minIntervalWidth > bounds.width()) |
174 return false; | 174 return false; |
175 | 175 |
176 float minY = LayoutUnit::fromFloatCeil(std::max(bounds.y(), minIntervalTop))
; | 176 float minY = LayoutUnit::fromFloatCeil(std::max(bounds.y(), minIntervalTop))
; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 if (intervalFitsWithinCorners || minY <= bounds.maxY() - cornerIntercep
t.y() - minIntervalHeight) { | 210 if (intervalFitsWithinCorners || minY <= bounds.maxY() - cornerIntercep
t.y() - minIntervalHeight) { |
211 result = minY; | 211 result = minY; |
212 return true; | 212 return true; |
213 } | 213 } |
214 } | 214 } |
215 | 215 |
216 return false; | 216 return false; |
217 } | 217 } |
218 | 218 |
219 } // namespace WebCore | 219 } // namespace WebCore |
OLD | NEW |