Chromium Code Reviews| Index: Source/core/rendering/RenderBoxModelObject.cpp |
| diff --git a/Source/core/rendering/RenderBoxModelObject.cpp b/Source/core/rendering/RenderBoxModelObject.cpp |
| index aada21668d2aeabe3d149fa3e8ad5fe5988748ad..b616443dd61f30c380829ede4d5dc2fff0fff31e 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()); |
| + int nrTiles = static_cast<int>(round((float)positioningAreaSize.width() / fillTileSize.width())); |
|
eseidel
2013/09/17 15:48:44
We don't have a helper function do to this for us?
Julien - ping for review
2013/09/17 16:26:27
lround would do the trick (or lroundf if we want t
|
| 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()); |
| + int nrTiles = static_cast<int>(round((float)positioningAreaSize.height() / fillTileSize.height())); |
| if (fillLayer->size().size.width().isAuto() && backgroundRepeatX != RoundFill) { |
| fillTileSize.setWidth(fillTileSize.width() * positioningAreaSize.height() / (nrTiles * fillTileSize.height())); |