summaryrefslogtreecommitdiff
path: root/layout/base
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-08-14 13:35:08 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-08-14 13:35:08 +0200
commit93bc70e0edff3fe2522d4351ab5e9ea1fc6dfc1b (patch)
treedf6b7f50f237b7e1fc4448db2588657a5a34130d /layout/base
parentf0563c914edfd1afe397ff89af2d6867d65cac0e (diff)
downloaduxp-93bc70e0edff3fe2522d4351ab5e9ea1fc6dfc1b.tar.gz
Issue mcp-graveyard/UXP#438: Do not round the translation of an SVG frame.
This doesn't solve the blurriness yet, but is part of the problem.
Diffstat (limited to 'layout/base')
-rw-r--r--layout/base/nsDisplayList.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp
index e35e027e30..cd0c623df9 100644
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -5917,6 +5917,12 @@ nsDisplayTransform::GetResultingTransformMatrixInternal(const FrameTransformProp
frame && frame->IsSVGTransformed(&svgTransform, &transformFromSVGParent);
bool hasTransformFromSVGParent =
hasSVGTransforms && !transformFromSVGParent.IsIdentity();
+
+ // An SVG frame should not have its translation rounded.
+ // Note it's possible that the SVG frame doesn't have an SVG
+ // transform but only has a CSS transform.
+ bool shouldRound = !(frame && frame->IsFrameOfType(nsIFrame::eSVG));
+
/* Transformed frames always have a transform, or are preserving 3d (and might still have perspective!) */
if (aProperties.mTransformList) {
result = nsStyleTransformMatrix::ReadTransforms(aProperties.mTransformList->mHead,
@@ -5994,7 +6000,7 @@ nsDisplayTransform::GetResultingTransformMatrixInternal(const FrameTransformProp
// Otherwise we need to manually translate into our parent's coordinate
// space.
if (frame->IsTransformed()) {
- nsLayoutUtils::PostTranslate(result, frame->GetPosition(), aAppUnitsPerPixel, !hasSVGTransforms);
+ nsLayoutUtils::PostTranslate(result, frame->GetPosition(), aAppUnitsPerPixel, shouldRound);
}
Matrix4x4 parent =
GetResultingTransformMatrixInternal(props,
@@ -6005,7 +6011,7 @@ nsDisplayTransform::GetResultingTransformMatrixInternal(const FrameTransformProp
}
if (aFlags & OFFSET_BY_ORIGIN) {
- nsLayoutUtils::PostTranslate(result, aOrigin, aAppUnitsPerPixel, !hasSVGTransforms);
+ nsLayoutUtils::PostTranslate(result, aOrigin, aAppUnitsPerPixel, shouldRound);
}
return result;