Returns the normalized range: (top-left, bottom-right) in reading order.
(&self)
| 65 | |
| 66 | /// Returns the normalized range: (top-left, bottom-right) in reading order. |
| 67 | fn range(&self) -> Option<((u16, u16), (u16, u16))> { |
| 68 | match (self.anchor, self.cursor) { |
| 69 | (Some(a), Some(b)) => { |
| 70 | if a.0 < b.0 || (a.0 == b.0 && a.1 <= b.1) { |
| 71 | Some((a, b)) |
| 72 | } else { |
| 73 | Some((b, a)) |
| 74 | } |
| 75 | } |
| 76 | _ => None, |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | /// Test whether a specific cell is inside the selection. |
| 81 | pub fn is_selected(&self, row: u16, col: u16) -> bool { |
no outgoing calls
no test coverage detected