pub struct SelectionGeometry {
pub start_selection_point: Option<SelectionPoint>,
pub end_selection_point: Option<SelectionPoint>,
pub status: SelectionStatus,
pub selection_rects: Vec<Rect>,
pub has_content: bool,
}Expand description
The geometry of the current selection, in the local coordinates of the selectable.
Fields§
§start_selection_point: Option<SelectionPoint>The geometry at the selection start, None when it is offstage.
end_selection_point: Option<SelectionPoint>The geometry at the selection end, None when it is offstage.
status: SelectionStatusThe status of the ongoing selection.
selection_rects: Vec<Rect>The rects that represent the selection, if there is any.
has_content: boolWhether there is any selectable content.
Implementations§
Source§impl SelectionGeometry
impl SelectionGeometry
Sourcepub fn new(status: SelectionStatus, has_content: bool) -> SelectionGeometry
pub fn new(status: SelectionStatus, has_content: bool) -> SelectionGeometry
Creates a selection geometry with no selection points and no rects; the setters give them, as Dart’s optional arguments.
Sourcepub fn start_selection_point(
self,
value: Option<SelectionPoint>,
) -> SelectionGeometry
pub fn start_selection_point( self, value: Option<SelectionPoint>, ) -> SelectionGeometry
Dart SelectionGeometry(startSelectionPoint:).
Sourcepub fn end_selection_point(
self,
value: Option<SelectionPoint>,
) -> SelectionGeometry
pub fn end_selection_point( self, value: Option<SelectionPoint>, ) -> SelectionGeometry
Dart SelectionGeometry(endSelectionPoint:).
Sourcepub fn selection_rects(self, value: Vec<Rect>) -> SelectionGeometry
pub fn selection_rects(self, value: Vec<Rect>) -> SelectionGeometry
Dart SelectionGeometry(selectionRects:).
Sourcepub fn status(self, value: SelectionStatus) -> SelectionGeometry
pub fn status(self, value: SelectionStatus) -> SelectionGeometry
Dart SelectionGeometry(status:).
Sourcepub fn has_content(self, value: bool) -> SelectionGeometry
pub fn has_content(self, value: bool) -> SelectionGeometry
Dart SelectionGeometry(hasContent:).
Sourcepub fn has_selection(&self) -> bool
pub fn has_selection(&self) -> bool
Whether there is an ongoing selection.
Sourcepub fn copy_with(&self) -> SelectionGeometry
pub fn copy_with(&self) -> SelectionGeometry
A copy the setters then change, as Dart’s copyWith.
Trait Implementations§
Source§impl Clone for SelectionGeometry
impl Clone for SelectionGeometry
Source§impl Debug for SelectionGeometry
impl Debug for SelectionGeometry
Source§impl PartialEq for SelectionGeometry
impl PartialEq for SelectionGeometry
impl StructuralPartialEq for SelectionGeometry
Auto Trait Implementations§
impl Forget for SelectionGeometry
impl Freeze for SelectionGeometry
impl Move for SelectionGeometry
impl RefUnwindSafe for SelectionGeometry
impl Send for SelectionGeometrywhere
RawVecInner: Send,
impl Sync for SelectionGeometrywhere
RawVecInner: Sync,
impl Unpin for SelectionGeometry
impl UnsafeUnpin for SelectionGeometry
impl UnwindSafe for SelectionGeometrywhere
RawVecInner: UnwindSafe,
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