pub struct ClippingPath { /* private fields */ }Expand description
Clipping path state
Implementations§
Source§impl ClippingPath
impl ClippingPath
Sourcepub fn rect(x: f64, y: f64, width: f64, height: f64) -> Self
pub fn rect(x: f64, y: f64, width: f64, height: f64) -> Self
Create a rectangular clipping path
Sourcepub fn with_winding_rule(self, rule: WindingRule) -> Self
pub fn with_winding_rule(self, rule: WindingRule) -> Self
Set the winding rule
Sourcepub fn as_text_clip(self) -> Self
pub fn as_text_clip(self) -> Self
Mark as text clipping path
Sourcepub fn curve_to(
&mut self,
x1: f64,
y1: f64,
x2: f64,
y2: f64,
x3: f64,
y3: f64,
) -> &mut Self
pub fn curve_to( &mut self, x1: f64, y1: f64, x2: f64, y2: f64, x3: f64, y3: f64, ) -> &mut Self
Add a cubic Bézier curve
Sourcepub fn add_rect(&mut self, x: f64, y: f64, width: f64, height: f64) -> &mut Self
pub fn add_rect(&mut self, x: f64, y: f64, width: f64, height: f64) -> &mut Self
Add a rectangle
Sourcepub fn add_circle(&mut self, cx: f64, cy: f64, radius: f64) -> &mut Self
pub fn add_circle(&mut self, cx: f64, cy: f64, radius: f64) -> &mut Self
Add a circle using Bézier curves
Sourcepub fn add_ellipse(&mut self, cx: f64, cy: f64, rx: f64, ry: f64) -> &mut Self
pub fn add_ellipse(&mut self, cx: f64, cy: f64, rx: f64, ry: f64) -> &mut Self
Add an ellipse using Bézier curves
Sourcepub fn add_rounded_rect(
&mut self,
x: f64,
y: f64,
width: f64,
height: f64,
radius: f64,
) -> &mut Self
pub fn add_rounded_rect( &mut self, x: f64, y: f64, width: f64, height: f64, radius: f64, ) -> &mut Self
Add a rounded rectangle
Sourcepub fn add_polygon(&mut self, points: &[(f64, f64)]) -> &mut Self
pub fn add_polygon(&mut self, points: &[(f64, f64)]) -> &mut Self
Add a polygon
Sourcepub fn close_path(&mut self) -> &mut Self
pub fn close_path(&mut self) -> &mut Self
Close the current subpath
Sourcepub fn commands(&self) -> &[PathCommand]
pub fn commands(&self) -> &[PathCommand]
Get the path commands
Sourcepub fn to_pdf_operations(&self) -> Result<String>
pub fn to_pdf_operations(&self) -> Result<String>
Generate PDF operations for this clipping path
Sourcepub fn intersect(&mut self, other: &ClippingPath) -> &mut Self
pub fn intersect(&mut self, other: &ClippingPath) -> &mut Self
Intersect with another clipping path
Trait Implementations§
Source§impl Clone for ClippingPath
impl Clone for ClippingPath
Source§fn clone(&self) -> ClippingPath
fn clone(&self) -> ClippingPath
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClippingPath
impl Debug for ClippingPath
Auto Trait Implementations§
impl Freeze for ClippingPath
impl RefUnwindSafe for ClippingPath
impl Send for ClippingPath
impl Sync for ClippingPath
impl Unpin for ClippingPath
impl UnwindSafe for ClippingPath
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().