pub struct Line<'a> {
pub style: Style,
/* private fields */
}Expand description
Connected line-segment widget backed by a borrowed point slice.
The lifetime parameter ties the widget to its point storage. The widget never stores raw pointers and never copies the point slice.
Fields§
§style: StyleStyle used for the line stroke.
border_color supplies the stroke color, border_width supplies the
stroke width in pixels, and alpha modulates the final stroke alpha.
Implementations§
Source§impl<'a> Line<'a>
impl<'a> Line<'a>
Sourcepub fn new(bounds: Rect, points: &'a [Point]) -> Self
pub fn new(bounds: Rect, points: &'a [Point]) -> Self
Create a line widget with borrowed point storage.
The default stroke is one pixel wide using Style::default’s border
color so a newly created line is visible without additional styling.
Sourcepub fn set_points(&mut self, points: &'a [Point])
pub fn set_points(&mut self, points: &'a [Point])
Replace the borrowed point slice.
Sourcepub fn set_y_invert(&mut self, y_invert: bool)
pub fn set_y_invert(&mut self, y_invert: bool)
Enable or disable bottom-origin y coordinate mapping.
Trait Implementations§
Source§impl Widget for Line<'_>
impl Widget for Line<'_>
Source§fn handle_event(&mut self, _event: &Event) -> bool
fn handle_event(&mut self, _event: &Event) -> bool
Handle an event and return
true if it was consumed. Read moreSource§fn set_bounds(&mut self, bounds: Rect)
fn set_bounds(&mut self, bounds: Rect)
Called by the LPAR-10 layout pass to notify this widget of its
layout-computed bounds. Read more
Source§fn clear_region(&mut self) -> Option<Rect>
fn clear_region(&mut self) -> Option<Rect>
Return a region (in draw/landscape coordinates) that should be
restored from the pristine background copy, or
None. Read moreSource§fn widget_font_mut(&mut self) -> Option<&mut WidgetFont>
fn widget_font_mut(&mut self) -> Option<&mut WidgetFont>
Expose this widget’s font slot for cascade-driven font resolution
(FONT-05 §5.B). Read more
Auto Trait Implementations§
impl<'a> Freeze for Line<'a>
impl<'a> RefUnwindSafe for Line<'a>
impl<'a> Send for Line<'a>
impl<'a> Sync for Line<'a>
impl<'a> Unpin for Line<'a>
impl<'a> UnsafeUnpin for Line<'a>
impl<'a> UnwindSafe for Line<'a>
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