Expand description
Representation of the <transform>
type.
Fields
a: f64
b: f64
c: f64
d: f64
e: f64
f: f64
Implementations
sourceimpl Transform
impl Transform
sourcepub fn new(a: f64, b: f64, c: f64, d: f64, e: f64, f: f64) -> Transform
pub fn new(a: f64, b: f64, c: f64, d: f64, e: f64, f: f64) -> Transform
Constructs a new transform.
sourcepub fn new_translate(x: f64, y: f64) -> Transform
pub fn new_translate(x: f64, y: f64) -> Transform
Constructs a new translate transform.
sourcepub fn new_rotate(angle: f64) -> Transform
pub fn new_rotate(angle: f64) -> Transform
Constructs a new rotate transform.
sourcepub fn new_rotate_at(angle: f64, x: f64, y: f64) -> Transform
pub fn new_rotate_at(angle: f64, x: f64, y: f64) -> Transform
Constructs a new rotate transform at the specified position.
sourcepub fn new_skew_x(angle: f64) -> Transform
pub fn new_skew_x(angle: f64) -> Transform
Constructs a new skew transform along then X axis.
sourcepub fn new_skew_y(angle: f64) -> Transform
pub fn new_skew_y(angle: f64) -> Transform
Constructs a new skew transform along then Y axis.
sourcepub fn rotate_at(&mut self, angle: f64, x: f64, y: f64)
pub fn rotate_at(&mut self, angle: f64, x: f64, y: f64)
Rotates the current transform at the specified position.
sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
Returns true
if the transform is default, aka (1 0 0 1 0 0)
.
sourcepub fn is_translate(&self) -> bool
pub fn is_translate(&self) -> bool
Returns true
if the transform contains only translate part, aka (1 0 0 1 x y)
.
sourcepub fn is_scale(&self) -> bool
pub fn is_scale(&self) -> bool
Returns true
if the transform contains only scale part, aka (sx 0 0 sy 0 0)
.
sourcepub fn has_translate(&self) -> bool
pub fn has_translate(&self) -> bool
Returns true
if the transform contains translate part.
sourcepub fn has_proportional_scale(&self) -> bool
pub fn has_proportional_scale(&self) -> bool
Returns true
if the transform scale is proportional.
The proportional scale is when <sx>
equal to <sy>
.
sourcepub fn has_rotate(&self) -> bool
pub fn has_rotate(&self) -> bool
Returns true
if the transform contains rotate part.
sourcepub fn get_translate(&self) -> (f64, f64)
pub fn get_translate(&self) -> (f64, f64)
Returns transform’s translate part.
sourcepub fn get_rotate(&self) -> f64
pub fn get_rotate(&self) -> f64
Returns transform’s rotate part.
Trait Implementations
sourceimpl From<Transform> for AttributeValue
impl From<Transform> for AttributeValue
sourcefn from(value: Transform) -> AttributeValue
fn from(value: Transform) -> AttributeValue
sourceimpl WriteBuffer for Transform
impl WriteBuffer for Transform
sourcefn write_buf_opt(&self, opt: &WriteOptions, buf: &mut Vec<u8, Global>)
fn write_buf_opt(&self, opt: &WriteOptions, buf: &mut Vec<u8, Global>)
Vec<u8>
buffer using specified WriteOptions
.sourcefn write_buf(&self, buf: &mut Vec<u8, Global>)
fn write_buf(&self, buf: &mut Vec<u8, Global>)
Vec<u8>
buffer using default WriteOptions
.sourcefn with_write_opt<'a>(&'a self, opt: &'a WriteOptions) -> DisplaySvg<'a, Self>where
Self: Sized,
fn with_write_opt<'a>(&'a self, opt: &'a WriteOptions) -> DisplaySvg<'a, Self>where
Self: Sized,
fmt::Display
using provided write options.