Skip to content

Commit ac28b29

Browse files
committed
working
1 parent 5ea6f2a commit ac28b29

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

crates/processing_glfw/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,12 @@ impl GlfwContext {
301301
input_set_focus(surface, focused).unwrap();
302302
}
303303
WindowEvent::Size(width, height) => {
304-
processing_render::surface_resize(surface, width.max(1) as u32, height.max(1) as u32)
305-
.unwrap();
304+
processing_render::surface_resize(
305+
surface,
306+
width.max(1) as u32,
307+
height.max(1) as u32,
308+
)
309+
.unwrap();
306310
}
307311
_ => {}
308312
}

crates/processing_pyo3/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ use graphics::{
3434
};
3535
use material::Material;
3636

37-
use processing_render::surface_logical_width;
3837
use pyo3::{
3938
BoundObject,
4039
exceptions::PyRuntimeError,
@@ -121,9 +120,9 @@ pub(crate) fn reset_tracked_globals() {
121120
fn sync_globals(module: &Bound<'_, PyModule>, globals: &Bound<'_, PyAny>) -> PyResult<()> {
122121
let graphics =
123122
get_graphics(module)?.ok_or_else(|| PyRuntimeError::new_err("call size() first"))?;
124-
let width = ::processing::prelude::surface_logical_width(graphics.surface.entity)
123+
let width = ::processing::prelude::surface_width(graphics.surface.entity)
125124
.map_err(|e| PyRuntimeError::new_err(format!("{e}")))?;
126-
let height = ::processing::prelude::surface_logical_height(graphics.surface.entity)
125+
let height = ::processing::prelude::surface_height(graphics.surface.entity)
127126
.map_err(|e| PyRuntimeError::new_err(format!("{e}")))?;
128127
input::sync_globals(globals, graphics.surface.entity, width, height)?;
129128
surface::sync_globals(globals, &graphics.surface, width, height)?;

crates/processing_render/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,20 +1702,20 @@ pub fn surface_physical_height(entity: Entity) -> error::Result<u32> {
17021702
})
17031703
}
17041704

1705-
pub fn surface_logical_width(entity: Entity) -> error::Result<u32> {
1705+
pub fn surface_width(entity: Entity) -> error::Result<u32> {
17061706
app_mut(|app| {
17071707
Ok(app
17081708
.world_mut()
1709-
.run_system_cached_with(surface::logical_width, entity)
1709+
.run_system_cached_with(surface::width, entity)
17101710
.unwrap())
17111711
})
17121712
}
17131713

1714-
pub fn surface_logical_height(entity: Entity) -> error::Result<u32> {
1714+
pub fn surface_height(entity: Entity) -> error::Result<u32> {
17151715
app_mut(|app| {
17161716
Ok(app
17171717
.world_mut()
1718-
.run_system_cached_with(surface::logical_height, entity)
1718+
.run_system_cached_with(surface::height, entity)
17191719
.unwrap())
17201720
})
17211721
}

crates/processing_render/src/surface.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ use processing_core::error::{self, ProcessingError, Result};
4040
#[cfg(not(target_os = "windows"))]
4141
use std::ptr::NonNull;
4242

43-
use crate::{
44-
graphics::SurfaceSize,
45-
image::Image,
46-
};
43+
use crate::{graphics::SurfaceSize, image::Image};
4744

4845
#[derive(Component, Debug, Clone)]
4946
pub struct Surface;
@@ -464,14 +461,14 @@ pub fn physical_height(In(entity): In<Entity>, query: Query<&Window>) -> u32 {
464461
.unwrap_or(0)
465462
}
466463

467-
pub fn logical_width(In(entity): In<Entity>, query: Query<&Window>) -> u32 {
464+
pub fn width(In(entity): In<Entity>, query: Query<&Window>) -> u32 {
468465
query
469466
.get(entity)
470467
.map(|w| w.resolution.width() as u32)
471468
.unwrap_or(0)
472469
}
473470

474-
pub fn logical_height(In(entity): In<Entity>, query: Query<&Window>) -> u32 {
471+
pub fn height(In(entity): In<Entity>, query: Query<&Window>) -> u32 {
475472
query
476473
.get(entity)
477474
.map(|w| w.resolution.height() as u32)

0 commit comments

Comments
 (0)