[][src]Enum svgbob::Fragment

pub enum Fragment {
    Line(Line),
    MarkerLine(MarkerLine),
    Circle(Circle),
    Arc(Arc),
    Polygon(Polygon),
    Rect(Rect),
    CellText(CellText),
    Text(Text),
}
This example is not tested
     0 1 2 3 4           B C D
    0┌─┬─┬─┬─┐        A┌─┬─┬─┬─┐E
    1├─┼─┼─┼─┤         │ │ │ │ │
    2├─┼─┼─┼─┤        F├─G─H─I─┤J
    3├─┼─┼─┼─┤         │ │ │ │ │
    4├─┼─┼─┼─┤        K├─L─M─N─┤O
    5├─┼─┼─┼─┤         │ │ │ │ │
    6├─┼─┼─┼─┤        P├─Q─R─S─┤T
    7├─┼─┼─┼─┤         │ │ │ │ │
    8└─┴─┴─┴─┘        U└─┴─┴─┴─┘Y
```                      V W X

Variants

Line(Line)
MarkerLine(MarkerLine)
Circle(Circle)
Arc(Arc)
Polygon(Polygon)
Rect(Rect)
CellText(CellText)
Text(Text)

Methods

impl Fragment[src]

pub fn match_unicode(fragments: &Vec<Self>) -> Option<char>[src]

get the character that matches the shape present on this cell

pub fn can_merge(&self, other: &Self) -> bool[src]

check if 2 fragments can merge into one FIXME: This is only merging lines and text right now

pub fn merge(&self, other: &Self) -> Option<Self>[src]

FIXME: This is only merging lines and text right now

pub fn absolute_position(&self, cell: Cell) -> Self[src]

recompute the end points of this fragment offset by the cell location

pub fn scale(&self, scale: f32) -> Self[src]

enlarge or shrink this fragment at scale

pub fn align(&self) -> Self[src]

pub fn as_line(&self) -> Option<&Line>[src]

pub fn as_polygon(&self) -> Option<&Polygon>[src]

pub fn as_arc(&self) -> Option<&Arc>[src]

pub fn as_cell_text(&self) -> Option<&CellText>[src]

pub fn as_text(&self) -> Option<&Text>[src]

pub fn as_css_tag(&self) -> Vec<String>[src]

if this is a cell text and is wrapped in braces then it is a css tag for the container

pub fn as_circle(&self) -> Option<&Circle>[src]

pub fn is_circle(&self) -> bool[src]

pub fn is_rect(&self) -> bool[src]

pub fn is_text(&self) -> bool[src]

pub fn is_cell_text(&self) -> bool[src]

pub fn is_broken(&self) -> bool[src]

Trait Implementations

impl Bounds for Fragment[src]

impl Clone for Fragment[src]

impl Debug for Fragment[src]

impl Display for Fragment[src]

impl Eq for Fragment[src]

impl From<Arc> for Fragment[src]

impl From<Circle> for Fragment[src]

impl From<Line> for Fragment[src]

impl From<Rect> for Fragment[src]

impl From<Text> for Fragment[src]

impl Into<Fragment> for CellText[src]

impl Into<Node<&'static str, (), ()>> for Fragment[src]

impl Ord for Fragment[src]

impl PartialEq<Fragment> for Fragment[src]

impl PartialOrd<Fragment> for Fragment[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.