Returns true if the point falls within the canvas bounds.
(&self, xy: PixelsXY)
| 146 | |
| 147 | /// Returns true if the point falls within the canvas bounds. |
| 148 | fn contains_pixel(&self, xy: PixelsXY) -> bool { |
| 149 | xy.x >= 0 |
| 150 | && xy.y >= 0 |
| 151 | && u16::try_from(xy.x).unwrap_or(u16::MAX) < self.size_pixels.width |
| 152 | && u16::try_from(xy.y).unwrap_or(u16::MAX) < self.size_pixels.height |
| 153 | } |
| 154 | |
| 155 | /// Sets the fill color of the canvas to `rgb`. |
| 156 | fn set_fill_style_rgb(&mut self, rgb: RGB) { |