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

Unified Diff: Source/WebCore/platform/graphics/IntSize.h

Issue 10379031: Merge 114095 - Background width (or height) is wrong if width (or height) * zoom < 1. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 7 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 | « Source/WebCore/loader/cache/CachedImage.cpp ('k') | Source/WebCore/rendering/RenderBoxModelObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/graphics/IntSize.h
===================================================================
--- Source/WebCore/platform/graphics/IntSize.h (revision 116270)
+++ Source/WebCore/platform/graphics/IntSize.h (working copy)
@@ -80,13 +80,18 @@
m_width += width;
m_height += height;
}
+
+ void scale(float widthScale, float heightScale)
+ {
+ m_width = static_cast<int>(static_cast<float>(m_width) * widthScale);
+ m_height = static_cast<int>(static_cast<float>(m_height) * heightScale);
+ }
void scale(float scale)
{
- m_width = static_cast<int>(static_cast<float>(m_width) * scale);
- m_height = static_cast<int>(static_cast<float>(m_height) * scale);
+ this->scale(scale, scale);
}
-
+
IntSize expandedTo(const IntSize& other) const
{
return IntSize(m_width > other.m_width ? m_width : other.m_width,
@@ -104,6 +109,14 @@
*this = expandedTo(IntSize());
}
+ void clampToMinimumSize(const IntSize& minimumSize)
+ {
+ if (m_width < minimumSize.width())
+ m_width = minimumSize.width();
+ if (m_height < minimumSize.height())
+ m_height = minimumSize.height();
+ }
+
int diagonalLengthSquared() const
{
return m_width * m_width + m_height * m_height;
« no previous file with comments | « Source/WebCore/loader/cache/CachedImage.cpp ('k') | Source/WebCore/rendering/RenderBoxModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698