aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental
diff options
context:
space:
mode:
Diffstat (limited to 'experimental')
-rw-r--r--experimental/skottie/Skottie.cpp3
-rw-r--r--experimental/sksg/geometry/SkSGTrimEffect.cpp6
2 files changed, 4 insertions, 5 deletions
diff --git a/experimental/skottie/Skottie.cpp b/experimental/skottie/Skottie.cpp
index becf3bf470..da3023d2e4 100644
--- a/experimental/skottie/Skottie.cpp
+++ b/experimental/skottie/Skottie.cpp
@@ -471,10 +471,9 @@ std::vector<sk_sp<sksg::GeometryNode>> AttachTrimGeometryEffect(
[](sksg::TrimEffect* node, const ScalarValue& e) {
node->setEnd(e * 0.01f);
});
- // TODO: "offset" doesn't currently work the same as BM - figure out what's going on.
BindProperty<ScalarValue>(jtrim["o"], ctx, trim,
[](sksg::TrimEffect* node, const ScalarValue& o) {
- node->setOffset(o * 0.01f);
+ node->setOffset(o / 360);
});
}
diff --git a/experimental/sksg/geometry/SkSGTrimEffect.cpp b/experimental/sksg/geometry/SkSGTrimEffect.cpp
index f3118221d5..afcc7e46b6 100644
--- a/experimental/sksg/geometry/SkSGTrimEffect.cpp
+++ b/experimental/sksg/geometry/SkSGTrimEffect.cpp
@@ -35,9 +35,9 @@ void TrimEffect::onDraw(SkCanvas* canvas, const SkPaint& paint) const {
pathLen += measure.getLength();
} while (measure.nextContour());
- const auto start = SkScalarPin(fStart , 0, 1) * pathLen,
- end = SkScalarPin(fEnd , 0, 1) * pathLen,
- offset = SkScalarPin(fOffset, 0, 1) * pathLen,
+ const auto start = pathLen * fStart,
+ end = pathLen * fEnd,
+ offset = pathLen * fOffset,
len = end - start;
if (len <= 0) {