diff options
Diffstat (limited to 'gfx/2d/BaseSize.h')
-rw-r--r-- | gfx/2d/BaseSize.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gfx/2d/BaseSize.h b/gfx/2d/BaseSize.h index 54c578d1d..bc057286e 100644 --- a/gfx/2d/BaseSize.h +++ b/gfx/2d/BaseSize.h @@ -6,6 +6,8 @@ #ifndef MOZILLA_GFX_BASESIZE_H_ #define MOZILLA_GFX_BASESIZE_H_ +#include "mozilla/Attributes.h" + namespace mozilla { namespace gfx { @@ -19,8 +21,8 @@ struct BaseSize { T width, height; // Constructors - BaseSize() : width(0), height(0) {} - BaseSize(T aWidth, T aHeight) : width(aWidth), height(aHeight) {} + MOZ_CONSTEXPR BaseSize() : width(0), height(0) {} + MOZ_CONSTEXPR BaseSize(T aWidth, T aHeight) : width(aWidth), height(aHeight) {} void SizeTo(T aWidth, T aHeight) { width = aWidth; height = aHeight; } @@ -67,6 +69,10 @@ struct BaseSize { Sub operator/(T aScale) const { return Sub(width / aScale, height / aScale); } + void Scale(T aXScale, T aYScale) { + width *= aXScale; + height *= aYScale; + } Sub operator*(const Sub& aSize) const { return Sub(width * aSize.width, height * aSize.height); |