Merge branch 'wasm-launchable' into wasm-input
This commit is contained in:
commit
fe6cb365f7
1 changed files with 4 additions and 6 deletions
|
|
@ -16,8 +16,7 @@ pub enum PaneId {
|
|||
Plugin(u32), // FIXME: Drop the trait object, make this a wrapper for the struct?
|
||||
BuiltIn(u32),
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Default)]
|
||||
pub struct PositionAndSize {
|
||||
pub x: usize,
|
||||
pub y: usize,
|
||||
|
|
@ -25,13 +24,12 @@ pub struct PositionAndSize {
|
|||
pub columns: usize,
|
||||
}
|
||||
|
||||
impl PositionAndSize {
|
||||
pub fn from(winsize: Winsize) -> PositionAndSize {
|
||||
impl From<Winsize> for PositionAndSize {
|
||||
fn from(winsize: Winsize) -> PositionAndSize {
|
||||
PositionAndSize {
|
||||
columns: winsize.ws_col as usize,
|
||||
rows: winsize.ws_row as usize,
|
||||
x: winsize.ws_xpixel as usize,
|
||||
y: winsize.ws_ypixel as usize,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue