1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/src/nsTransform2D.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,23 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 + 1.10 +#include "nsTransform2D.h" 1.11 + 1.12 +void nsTransform2D :: TransformCoord(nscoord *ptX, nscoord *ptY) const 1.13 +{ 1.14 + *ptX = NSToCoordRound(*ptX * m00 + m20); 1.15 + *ptY = NSToCoordRound(*ptY * m11 + m21); 1.16 +} 1.17 + 1.18 +void nsTransform2D :: TransformCoord(nscoord *aX, nscoord *aY, nscoord *aWidth, nscoord *aHeight) const 1.19 +{ 1.20 + nscoord x2 = *aX + *aWidth; 1.21 + nscoord y2 = *aY + *aHeight; 1.22 + TransformCoord(aX, aY); 1.23 + TransformCoord(&x2, &y2); 1.24 + *aWidth = x2 - *aX; 1.25 + *aHeight = y2 - *aY; 1.26 +}