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

Side by Side Diff: Source/core/rendering/shapes/RectangleShape.cpp

Issue 133123003: [CSS Shapes] First line gets incorrectly adjusted in shape-inside due to rounding (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/shapes/RectangleShape.h ('k') | Source/core/rendering/shapes/Shape.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/rendering/shapes/RectangleShape.h ('k') | Source/core/rendering/shapes/Shape.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698