rive_rs/shapes/paint/
stroke_effect.rs

1// Copyright 2021 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use std::fmt;
6use std::rc::Rc;
7
8use crate::core::ObjectRef;
9use crate::shapes::paint::TrimPath;
10use crate::shapes::{CommandPath, MetricsPath};
11
12pub fn as_ref(object_ref: ObjectRef<'_>) -> impl StrokeEffect + '_ {
13    object_ref.cast::<TrimPath>()
14}
15
16pub trait StrokeEffect: fmt::Debug {
17    fn effect_path(&self, source: &mut MetricsPath) -> Rc<CommandPath>;
18    fn invalidate_effect(&self);
19}