Skip to content

Commit c978ebd

Browse files
committed
Fmt.
1 parent 26babdc commit c978ebd

3 files changed

Lines changed: 16 additions & 13 deletions

File tree

crates/processing_pyo3/src/monitor.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ impl Monitor {
3737

3838
#[getter]
3939
pub fn position(&self) -> PyResult<(i32, i32)> {
40-
let p = monitor_position(self.entity)
41-
.map_err(|e| PyRuntimeError::new_err(format!("{e}")))?;
40+
let p =
41+
monitor_position(self.entity).map_err(|e| PyRuntimeError::new_err(format!("{e}")))?;
4242
Ok((p.x, p.y))
4343
}
4444

4545
#[getter]
4646
pub fn workarea(&self) -> PyResult<(i32, i32, i32, i32)> {
47-
let r = monitor_workarea(self.entity)
48-
.map_err(|e| PyRuntimeError::new_err(format!("{e}")))?;
47+
let r =
48+
monitor_workarea(self.entity).map_err(|e| PyRuntimeError::new_err(format!("{e}")))?;
4949
Ok((r.min.x, r.min.y, r.width(), r.height()))
5050
}
5151
}

crates/processing_pyo3/src/surface.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ impl Surface {
6262

6363
#[getter]
6464
pub fn position(&self) -> PyResult<(i32, i32)> {
65-
let p = surface_position(self.entity).map_err(|e| PyRuntimeError::new_err(format!("{e}")))?;
65+
let p =
66+
surface_position(self.entity).map_err(|e| PyRuntimeError::new_err(format!("{e}")))?;
6667
Ok((p.x, p.y))
6768
}
6869

6970
pub fn set_position(&self, x: i32, y: i32) -> PyResult<()> {
70-
surface_set_position(self.entity, x, y)
71-
.map_err(|e| PyRuntimeError::new_err(format!("{e}")))
71+
surface_set_position(self.entity, x, y).map_err(|e| PyRuntimeError::new_err(format!("{e}")))
7272
}
7373

7474
pub fn set_visible(&self, visible: bool) -> PyResult<()> {

crates/processing_render/src/surface.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ pub fn destroy(
382382
}
383383
}
384384

385-
/// Update window size when resized. No-op on offscreen surfaces (no `Window` component).
385+
/// Update window size when resized.
386386
pub fn resize(
387387
In((window_entity, width, height)): In<(Entity, u32, u32)>,
388388
mut windows: Query<&mut Window>,
@@ -440,9 +440,6 @@ pub fn physical_height(In(entity): In<Entity>, query: Query<&Window>) -> u32 {
440440
.unwrap_or(0)
441441
}
442442

443-
// Windowed-surface ops are no-ops for entities without a [`Window`] component, matching
444-
// PSurfaceNone's behaviour in Processing 4.
445-
446443
pub fn set_title(
447444
In((entity, title)): In<(Entity, String)>,
448445
mut windows: Query<&mut Window>,
@@ -574,7 +571,10 @@ pub fn monitor_workarea(
574571
Ok((monitor, None)) => IRect::from_corners(
575572
monitor.physical_position,
576573
monitor.physical_position
577-
+ IVec2::new(monitor.physical_width as i32, monitor.physical_height as i32),
574+
+ IVec2::new(
575+
monitor.physical_width as i32,
576+
monitor.physical_height as i32,
577+
),
578578
),
579579
Err(_) => IRect::from_corners(IVec2::ZERO, IVec2::ZERO),
580580
}
@@ -610,7 +610,10 @@ pub fn center_on_monitor(
610610
Ok((monitor, None)) => IRect::from_corners(
611611
monitor.physical_position,
612612
monitor.physical_position
613-
+ IVec2::new(monitor.physical_width as i32, monitor.physical_height as i32),
613+
+ IVec2::new(
614+
monitor.physical_width as i32,
615+
monitor.physical_height as i32,
616+
),
614617
),
615618
Err(_) => return Ok(()),
616619
};

0 commit comments

Comments
 (0)