Skip to content

struct

Transform

pub struct Transform {
    /* private fields */
}

One element's transform state.

Methods

get

pub fn get(&self, prop: &str) -> f64

The value of transform property prop (x, rotate…), or its default.

get_text

pub fn get_text(&self, prop: &str) -> String

The current value as a string (with its unit).

set

pub fn set(&mut self, prop: &str, value: &str)

Set from a string; units other than the canonical one are ignored (numbers are taken as-is).

css

pub fn css(&self) -> String

The CSS transform (GSAP's order: translate, rotate, skew, scale).

Trait implementations