From d3aed336d625e5e79fda2b7810479dc6a0432a45 Mon Sep 17 00:00:00 2001 From: Botond Ballo Date: Fri, 6 Mar 2015 18:07:30 -0500 Subject: [PATCH] Bug 1139675 - Add a couple of operator overloads to BaseSize. r=kats --HG-- extra : rebase_source : 83dc92abae4c970b93d9d6f6841392a6530d560d extra : source : 2d49fc7c82c580e115bfcca8709582a7a9abda6b --- gfx/2d/BaseSize.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gfx/2d/BaseSize.h b/gfx/2d/BaseSize.h index bc057286ea6d..2da956cced55 100644 --- a/gfx/2d/BaseSize.h +++ b/gfx/2d/BaseSize.h @@ -69,6 +69,9 @@ struct BaseSize { Sub operator/(T aScale) const { return Sub(width / aScale, height / aScale); } + friend Sub operator*(T aScale, const Sub& aSize) { + return Sub(aScale * aSize.width, aScale * aSize.height); + } void Scale(T aXScale, T aYScale) { width *= aXScale; height *= aYScale;