pub fn pivot(self, pivot: Pivot) -> Self {
        let offset = match pivot {
            Pivot::TopLeft => Coordinates::new(0., 0.),
            Pivot::Center => Coordinates::new(-(self.vertices[1].x - self.vertices[0].x).abs()/2., -(self.vertices[1].y - self.vertices[0].y).abs()/2.),
        };
        Line::new_with_offset(self.vertices, offset)
    }
/// Sets the pivot point of the line and returns it
Sets the pivot point of the line and returns it
Sets the pivot point of the line and returns it
pub fn pivot(self, pivot: Pivot) -> Self {
        let offset = match pivot {
            Pivot::TopLeft => Coordinates::new(0., 0.),
            Pivot::Center => Coordinates::new(-(self.vertices[1].x - self.vertices[0].x).abs()/2., -(self.vertices[1].y - self.vertices[0].y).abs()/2.),
        };
        Line::new_with_offset(self.vertices, offset)
    }
pub fn pivot ( self , pivot : Pivot ) -> Self { let offset = match pivot { Pivot :: TopLeft => Coordinates :: new ( 0. , 0. ) , Pivot :: Center => Coordinates :: new ( - ( self . vertices [ 1 ] . x - self . vertices [ 0 ] . x ) . abs ( ) / 2. , - ( self . vertices [ 1 ] . y - self . vertices [ 0 ] . y ) . abs ( ) / 2. ) , } ; Line :: new_with_offset ( self . vertices , offset ) }
Sets the pivot point of the line and returns it
Sets the pivot point of the line and returns it
self
pivot
Pivot
self
pivot
Pivot