Rip out buffer and widgets
I've decided to use the "taffy" crate for layouting. To make the API somewhat bearable to use, I've decided to perform all rendering in a good ol' rgb image buffer (in this case, an ImageBuffer from the "image" crate). The pixels will be converted to their final representation just before being sent to whatever device will be displaying them. I've removed the buffer and the color traits because they're no longer necessary. I've also removed the existing widgets because the widget system will have to be redesigned to work well with taffy.
This commit is contained in:
parent
04ed092c4f
commit
eb04b3fb50
13 changed files with 38 additions and 300 deletions
|
|
@ -20,6 +20,18 @@ impl Vec2 {
|
|||
Self { x, y }
|
||||
}
|
||||
|
||||
pub fn from_u32(x: u32, y: u32) -> Self {
|
||||
let x: i32 = x.try_into().expect("x too large");
|
||||
let y: i32 = y.try_into().expect("y too large");
|
||||
Self::new(x, y)
|
||||
}
|
||||
|
||||
pub fn to_u32(self) -> (u32, u32) {
|
||||
let x: u32 = self.x.try_into().expect("x too small");
|
||||
let y: u32 = self.y.try_into().expect("y too small");
|
||||
(x, y)
|
||||
}
|
||||
|
||||
/// The vector pointing from `self` to `other`.
|
||||
///
|
||||
/// ```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue