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

Method clear_cursor

std/src/console/graphics.rs:409–419  ·  view source on GitHub ↗

Clears the cursor at the current position by restoring the contents of the screen saved by an earlier call to `draw_cursor`. Does not present the canvas.

(&mut self)

Source from the content-addressed store, hash-verified

407 ///
408 /// Does not present the canvas.
409 fn clear_cursor(&mut self) -> io::Result<()> {
410 if !self.cursor_visible || self.cursor_backup.is_none() {
411 return Ok(());
412 }
413
414 let x1y1 = self.cursor_pos.clamped_mul(self.glyph_size);
415
416 self.raster_ops.put_pixels(x1y1, self.cursor_backup.as_ref().unwrap())?;
417 self.cursor_backup = None;
418 Ok(())
419 }
420
421 /// Moves the cursor to beginning of the next line, scrolling the console if necessary.
422 ///

Callers 7

clearMethod · 0.80
hide_cursorMethod · 0.80
leave_altMethod · 0.80
locateMethod · 0.80
move_within_lineMethod · 0.80
printMethod · 0.80
writeMethod · 0.80

Calls 2

clamped_mulMethod · 0.80
put_pixelsMethod · 0.45

Tested by

no test coverage detected