pub struct TransDoublePath { /* private fields */ }Expand description
Double-path coordinate transformation.
Stores two paths as sequences of vertices with cumulative distances.
transform() maps x → distance along path1 (and path2 scaled proportionally),
y → linear interpolation between the two paths based on base_height.
Used for text-between-two-curves effects.
Implementations§
Source§impl TransDoublePath
impl TransDoublePath
pub fn new() -> Self
pub fn set_base_length(&mut self, v: f64)
pub fn base_length(&self) -> f64
pub fn set_base_height(&mut self, v: f64)
pub fn base_height(&self) -> f64
pub fn set_preserve_x_scale(&mut self, f: bool)
pub fn preserve_x_scale(&self) -> bool
pub fn reset(&mut self)
pub fn move_to1(&mut self, x: f64, y: f64)
pub fn line_to1(&mut self, x: f64, y: f64)
pub fn move_to2(&mut self, x: f64, y: f64)
pub fn line_to2(&mut self, x: f64, y: f64)
Sourcepub fn add_paths<VS1: VertexSource, VS2: VertexSource>(
&mut self,
vs1: &mut VS1,
vs2: &mut VS2,
path1_id: u32,
path2_id: u32,
)
pub fn add_paths<VS1: VertexSource, VS2: VertexSource>( &mut self, vs1: &mut VS1, vs2: &mut VS2, path1_id: u32, path2_id: u32, )
Build both paths from two VertexSources and finalize.
Sourcepub fn finalize_paths(&mut self)
pub fn finalize_paths(&mut self)
Finalize both paths — compute cumulative distances and prepare for transform.
Sourcepub fn total_length1(&self) -> f64
pub fn total_length1(&self) -> f64
Total length of path 1 (or base_length if set).
Sourcepub fn total_length2(&self) -> f64
pub fn total_length2(&self) -> f64
Total length of path 2 (or base_length if set).
Trait Implementations§
Source§impl Default for TransDoublePath
impl Default for TransDoublePath
Source§impl Transformer for TransDoublePath
impl Transformer for TransDoublePath
Auto Trait Implementations§
impl Freeze for TransDoublePath
impl RefUnwindSafe for TransDoublePath
impl Send for TransDoublePath
impl Sync for TransDoublePath
impl Unpin for TransDoublePath
impl UnwindSafe for TransDoublePath
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more