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

Side by Side Diff: Source/core/rendering/shapes/ShapeInsideInfo.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/ShapeInsideInfo.h ('k') | no next file » | 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 return m_segments.size(); 85 return m_segments.size();
86 } 86 }
87 87
88 bool ShapeInsideInfo::adjustLogicalLineTop(float minSegmentWidth) 88 bool ShapeInsideInfo::adjustLogicalLineTop(float minSegmentWidth)
89 { 89 {
90 const Shape* shape = computedShape(); 90 const Shape* shape = computedShape();
91 if (!shape || m_lineHeight <= 0 || logicalLineTop() > shapeLogicalBottom()) 91 if (!shape || m_lineHeight <= 0 || logicalLineTop() > shapeLogicalBottom())
92 return false; 92 return false;
93 93
94 LayoutUnit newLineTop; 94 LayoutUnit newLineTop;
95 if (shape->firstIncludedIntervalLogicalTop(m_shapeLineTop, LayoutSize(minSeg mentWidth, m_lineHeight), newLineTop)) { 95 if (shape->firstIncludedIntervalLogicalTop(m_shapeLineTop, FloatSize(minSegm entWidth, m_lineHeight), newLineTop)) {
96 if (newLineTop > m_shapeLineTop) { 96 if (newLineTop > m_shapeLineTop) {
97 m_shapeLineTop = newLineTop; 97 m_shapeLineTop = newLineTop;
98 return true; 98 return true;
99 } 99 }
100 } 100 }
101 101
102 return false; 102 return false;
103 } 103 }
104 104
105 ShapeValue* ShapeInsideInfo::shapeValue() const 105 ShapeValue* ShapeInsideInfo::shapeValue() const
106 { 106 {
107 return m_renderer->style()->resolvedShapeInside(); 107 return m_renderer->style()->resolvedShapeInside();
108 } 108 }
109 109
110 LayoutUnit ShapeInsideInfo::computeFirstFitPositionForFloat(const LayoutSize flo atSize) const 110 LayoutUnit ShapeInsideInfo::computeFirstFitPositionForFloat(const FloatSize& flo atSize) const
111 { 111 {
112 if (!computedShape() || !floatSize.width() || shapeLogicalBottom() < logical LineTop()) 112 if (!computedShape() || !floatSize.width() || shapeLogicalBottom() < logical LineTop())
113 return 0; 113 return 0;
114 114
115 LayoutUnit firstFitPosition = 0; 115 LayoutUnit firstFitPosition = 0;
116 if (computedShape()->firstIncludedIntervalLogicalTop(m_shapeLineTop, floatSi ze, firstFitPosition) && (m_shapeLineTop <= firstFitPosition)) 116 if (computedShape()->firstIncludedIntervalLogicalTop(m_shapeLineTop, floatSi ze, firstFitPosition) && (m_shapeLineTop <= firstFitPosition))
117 return firstFitPosition; 117 return firstFitPosition;
118 118
119 return 0; 119 return 0;
120 } 120 }
121 121
122 } 122 }
OLDNEW
« no previous file with comments | « Source/core/rendering/shapes/ShapeInsideInfo.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698