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

Unified Diff: third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp

Issue 2392443009: reflow comments in core/paint (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp
diff --git a/third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp b/third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp
index 4d9cbb5ac25c20d2178bb1c38d27babdf11d464c..6212642cada8bfb2383a3532d4e93c71c47b586e 100644
--- a/third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp
+++ b/third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp
@@ -59,9 +59,10 @@ NinePieceImageGrid::NinePieceImageGrid(const NinePieceImage& ninePieceImage,
borderWidths.left(), m_left.slice,
borderImageArea.width());
- // The spec says: Given Lwidth as the width of the border image area, Lheight as its height, and Wside as the border
- // image width offset for the side, let f = min(Lwidth/(Wleft+Wright), Lheight/(Wtop+Wbottom)). If f < 1, then all W
- // are reduced by multiplying them by f.
+ // The spec says: Given Lwidth as the width of the border image area, Lheight
+ // as its height, and Wside as the border image width offset for the side, let
+ // f = min(Lwidth/(Wleft+Wright), Lheight/(Wtop+Wbottom)). If f < 1, then all
+ // W are reduced by multiplying them by f.
int borderSideWidth = std::max(1, m_left.width + m_right.width);
int borderSideHeight = std::max(1, m_top.width + m_bottom.width);
float borderSideScaleFactor =
@@ -75,8 +76,8 @@ NinePieceImageGrid::NinePieceImageGrid(const NinePieceImage& ninePieceImage,
}
}
-// Given a rectangle, construct a subrectangle using offset, width and height. Negative offsets are relative to the
-// extent of the given rectangle.
+// Given a rectangle, construct a subrectangle using offset, width and height.
+// Negative offsets are relative to the extent of the given rectangle.
static FloatRect subrect(IntRect rect,
float offsetX,
float offsetY,
@@ -258,9 +259,11 @@ void NinePieceImageGrid::setDrawInfoMiddle(NinePieceDrawInfo& drawInfo) const {
middleScaleFactor.setHeight(m_right.scale());
if (!sourceSize.isEmpty()) {
- // For "stretch" rules, just override the scale factor and replace. We only have to do this for the center tile,
- // since sides don't even use the scale factor unless they have a rule other than "stretch". The middle however
- // can have "stretch" specified in one axis but not the other, so we have to correct the scale here.
+ // For "stretch" rules, just override the scale factor and replace. We only
+ // have to do this for the center tile, since sides don't even use the scale
+ // factor unless they have a rule other than "stretch". The middle however
+ // can have "stretch" specified in one axis but not the other, so we have to
+ // correct the scale here.
if (m_horizontalTileRule == (Image::TileRule)StretchImageRule)
middleScaleFactor.setWidth((float)destinationSize.width() /
sourceSize.width());
@@ -292,8 +295,8 @@ NinePieceImageGrid::NinePieceDrawInfo NinePieceImageGrid::getNinePieceDrawInfo(
setDrawInfoMiddle(drawInfo);
if (imageScaleFactor != 1) {
- // The nine piece grid is computed in unscaled image coordinates but must be drawn using
- // scaled image coordinates.
+ // The nine piece grid is computed in unscaled image coordinates but must be
+ // drawn using scaled image coordinates.
drawInfo.source.scale(imageScaleFactor);
// Compensate for source scaling by scaling down the individual tiles.

Powered by Google App Engine
This is Rietveld 408576698