mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1193062 - Fix UntransformVector w coordinate checks. r=kip
It shouldn't be checking the w coordinate of the difference of two Point4Ds. The 4D difference isn't really meaningful. Instead, it should be checking each point's w coordinate individually.
This commit is contained in:
parent
ee7c0dada9
commit
eaad5c9458
@ -184,12 +184,12 @@ template <typename TargetUnits, typename SourceUnits>
|
||||
static Maybe<gfx::PointTyped<TargetUnits>> UntransformVector(const gfx::Matrix4x4& aTransform,
|
||||
const gfx::PointTyped<SourceUnits>& aVector,
|
||||
const gfx::PointTyped<SourceUnits>& aAnchor) {
|
||||
gfx::Point4D point = aTransform.ProjectPoint(aAnchor.ToUnknownPoint() + aVector.ToUnknownPoint())
|
||||
- aTransform.ProjectPoint(aAnchor.ToUnknownPoint());
|
||||
if (!point.HasPositiveWCoord()){
|
||||
gfx::Point4D projectedAnchor = aTransform.ProjectPoint(aAnchor.ToUnknownPoint());
|
||||
gfx::Point4D projectedTarget = aTransform.ProjectPoint(aAnchor.ToUnknownPoint() + aVector.ToUnknownPoint());
|
||||
if (!projectedAnchor.HasPositiveWCoord() || !projectedTarget.HasPositiveWCoord()){
|
||||
return Nothing();
|
||||
}
|
||||
return Some(ViewAs<TargetUnits>(point.As2DPoint()));
|
||||
return Some(ViewAs<TargetUnits>(projectedAnchor.As2DPoint() - projectedTarget.As2DPoint()));
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
Loading…
Reference in New Issue
Block a user