Bug 727681; correct gfx3DMatrix::CanDraw2D. r=Bas

This commit is contained in:
Nicholas Cameron 2012-02-17 18:06:46 +13:00
parent 407103f6cc
commit 08fafd3689
2 changed files with 7 additions and 3 deletions

View File

@ -714,8 +714,9 @@ gfx3DMatrix::Is2D(gfxMatrix* aMatrix) const
bool
gfx3DMatrix::CanDraw2D(gfxMatrix* aMatrix) const
{
if (_14 != 0.0f || _24 != 0.0f ||
_34 != 0.0f || _44 != 1.0f) {
if (_14 != 0.0f ||
_24 != 0.0f ||
_44 != 1.0f) {
return false;
}
if (aMatrix) {

View File

@ -114,7 +114,10 @@ public:
* Returns true if the matrix can be reduced to a 2D affine transformation
* (i.e. as obtained by From2D). If it is, optionally returns the 2D
* matrix in aMatrix. This should only be used on matrices required for
* rendering, not for intermediate calculations.
* rendering, not for intermediate calculations. It is assumed that the 2D
* matrix will only be used for transforming objects on to the z=0 plane,
* therefore any z-component perspective is ignored. This means that if
* aMatrix is applied to objects with z != 0, the results may be incorrect.
*
* Since drawing is to a 2d plane, any 3d transform without perspective
* can be reduced by dropping the z row and column.