xous-core/services/graphics-server/src/blitstr2.rs
bunnie 5452fae33c harmonize blitstr2 and graphics-server to an i16 pixel representation
previously blitstr2 is using usize for x/y coords, which means that
for layout purposes points could not go to the top or left boundary
without causing arithmetic overflow. Of course, you want to render
everything on-screen, but, as we have multi-line text with overflow
possibility, it's reasonable to be able to use negative coordinates
to locate text boxes that flow into the visible region.

This of course means that occassionally you can come out with
things like "negative widths", but even then, there can be reasonable
uses for this as an intermediate in calculations that ultimately
arrive at a positive result.
2022-03-28 23:17:18 +08:00

14 lines
No EOL
461 B
Rust

mod blit;
pub use blit::*;
mod cliprect;
pub use cliprect::*;
pub(crate) mod fonts;
pub(crate) use fonts::*;
const LINES: i16 = crate::backend::FB_LINES as i16;
const WIDTH: i16 = crate::backend::FB_WIDTH_PIXELS as i16;
const WORDS_PER_LINE: usize = crate::backend::FB_WIDTH_WORDS;
pub type FrBuf = [u32; WORDS_PER_LINE * LINES as usize];
// add more fonts (an example):
// https://github.com/samblenny/blitstr2/commit/bb7d4ab6a2d8913dcb520895a3c242c933413aae