MCPcopy Index your code
hub / github.com/endbasic/endbasic / contains_pixel

Method contains_pixel

sdl/src/host.rs:356–361  ·  view source on GitHub ↗

Returns true if the point falls within the canvas bounds.

(&self, xy: PixelsXY)

Source from the content-addressed store, hash-verified

354
355 /// Returns true if the point falls within the canvas bounds.
356 fn contains_pixel(&self, xy: PixelsXY) -> bool {
357 xy.x >= 0
358 && xy.y >= 0
359 && u16::try_from(xy.x).unwrap_or(u16::MAX) < self.size_pixels.width
360 && u16::try_from(xy.y).unwrap_or(u16::MAX) < self.size_pixels.height
361 }
362
363 /// Reproduces `tone` using SDL's audio queue.
364 fn play_tone(&mut self, tone: Tone) -> io::Result<()> {

Callers 1

peek_pixelMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected