mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 952011 - Don't restrict Untransform points/rects to the child bounds if we're not a projective matrix. r=bjacob
This commit is contained in:
parent
1339dec76d
commit
075dc50551
@ -721,6 +721,14 @@ gfx3DMatrix::Is2D(gfxMatrix* aMatrix) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
gfx3DMatrix::IsProjective() const
|
||||
{
|
||||
return _14 != 0.0f || _24 != 0.0f ||
|
||||
_34 != 0.0f || _44 != 1.0f;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
gfx3DMatrix::CanDraw2D(gfxMatrix* aMatrix) const
|
||||
{
|
||||
@ -810,6 +818,9 @@ gfxRect gfx3DMatrix::ProjectRectBounds(const gfxRect& aRect) const
|
||||
|
||||
gfxRect gfx3DMatrix::UntransformBounds(const gfxRect& aRect, const gfxRect& aChildBounds) const
|
||||
{
|
||||
if (!IsProjective()) {
|
||||
return Inverse().TransformBounds(aRect);
|
||||
}
|
||||
gfxRect bounds = TransformBounds(aChildBounds);
|
||||
|
||||
gfxRect rect = aRect.Intersect(bounds);
|
||||
@ -819,6 +830,10 @@ gfxRect gfx3DMatrix::UntransformBounds(const gfxRect& aRect, const gfxRect& aChi
|
||||
|
||||
bool gfx3DMatrix::UntransformPoint(const gfxPoint& aPoint, const gfxRect& aChildBounds, gfxPoint* aOut) const
|
||||
{
|
||||
if (!IsProjective()) {
|
||||
*aOut = Inverse().Transform(aPoint);
|
||||
return true;
|
||||
}
|
||||
gfxRect bounds = TransformBounds(aChildBounds);
|
||||
|
||||
if (!bounds.Contains(aPoint)) {
|
||||
|
@ -81,6 +81,8 @@ public:
|
||||
bool Is2D(gfxMatrix* aMatrix) const;
|
||||
bool Is2D() const;
|
||||
|
||||
bool IsProjective() const;
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
Loading…
Reference in New Issue
Block a user