Make sure that the coordinates are within the LCD space. This is only used to validate input parameters for those functions that are internal to the console (such as `move_pixels`). Functions subject to user input (such as `draw_rect`) must not use this.
(&mut self, xy: PixelsXY)
| 184 | /// console (such as `move_pixels`). Functions subject to user input (such as `draw_rect`) must |
| 185 | /// not use this. |
| 186 | fn assert_xy_in_range(&mut self, xy: PixelsXY) { |
| 187 | if cfg!(test) { |
| 188 | let x = usize::try_from(xy.x).expect("x must be positive and must fit"); |
| 189 | let y = usize::try_from(xy.y).expect("y must be positive and must fit"); |
| 190 | debug_assert!(x < self.size_pixels.width, "x must be within the LCD width"); |
| 191 | debug_assert!(y < self.size_pixels.height, "y must be within the LCD height"); |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | /// Make sure that the coordinates and size are within the LCD space. |
| 196 | /// |
no outgoing calls
no test coverage detected