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

Unified Diff: Source/core/rendering/RenderBoxModelObject.cpp

Issue 24066007: Mask/background-repeat: round should round the number of tiles of an image to the nearest natural n… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase 2 Created 7 years, 3 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
« no previous file with comments | « LayoutTests/ietestcenter/css3/bordersbackgrounds/background-size-aspect-ratio.htm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBoxModelObject.cpp
diff --git a/Source/core/rendering/RenderBoxModelObject.cpp b/Source/core/rendering/RenderBoxModelObject.cpp
index aada21668d2aeabe3d149fa3e8ad5fe5988748ad..f978c7a4ffd12272bd05d5d0e7921ffc3b84b580 100644
--- a/Source/core/rendering/RenderBoxModelObject.cpp
+++ b/Source/core/rendering/RenderBoxModelObject.cpp
@@ -1062,8 +1062,7 @@ void RenderBoxModelObject::calculateBackgroundImageGeometry(const FillLayer* fil
LayoutUnit computedXPosition = minimumValueForLength(fillLayer->xPosition(), availableWidth, renderView, true);
if (backgroundRepeatX == RoundFill && positioningAreaSize.width() > 0 && fillTileSize.width() > 0) {
- int nrTiles = ceil((double)positioningAreaSize.width() /
- fillTileSize.width());
+ long nrTiles = lroundf((float)positioningAreaSize.width() / fillTileSize.width());
if (fillLayer->size().size.height().isAuto() && backgroundRepeatY != RoundFill) {
fillTileSize.setHeight(fillTileSize.height() * positioningAreaSize.width() / (nrTiles * fillTileSize.width()));
@@ -1076,8 +1075,7 @@ void RenderBoxModelObject::calculateBackgroundImageGeometry(const FillLayer* fil
LayoutUnit computedYPosition = minimumValueForLength(fillLayer->yPosition(), availableHeight, renderView, true);
if (backgroundRepeatY == RoundFill && positioningAreaSize.height() > 0 && fillTileSize.height() > 0) {
- int nrTiles = ceil((double)positioningAreaSize.height() /
- fillTileSize.height());
+ long nrTiles = lroundf((float)positioningAreaSize.height() / fillTileSize.height());
if (fillLayer->size().size.width().isAuto() && backgroundRepeatX != RoundFill) {
fillTileSize.setWidth(fillTileSize.width() * positioningAreaSize.height() / (nrTiles * fillTileSize.height()));
« no previous file with comments | « LayoutTests/ietestcenter/css3/bordersbackgrounds/background-size-aspect-ratio.htm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698