mirror of
https://github.com/bspeice/speice.io
synced 2025-04-27 16:21:30 -04:00
Formatting
This commit is contained in:
parent
98d9111688
commit
8aeb3cc32a
@ -62,7 +62,11 @@ pub fn main_fs(
|
|||||||
let img_coord = (frag_coord.xy() - viewport.offset.as_vec2()) / scale - img_offset;
|
let img_coord = (frag_coord.xy() - viewport.offset.as_vec2()) / scale - img_offset;
|
||||||
|
|
||||||
*output = if img_coord.cmpge(glam::Vec2::ZERO).all() && img_coord.cmple(img_size).all() {
|
*output = if img_coord.cmpge(glam::Vec2::ZERO).all() && img_coord.cmple(img_size).all() {
|
||||||
image[image_index(img_coord.x as usize, img_coord.y as usize, viewport.image.x as usize)]
|
image[image_index(
|
||||||
|
img_coord.x as usize,
|
||||||
|
img_coord.y as usize,
|
||||||
|
viewport.image.x as usize,
|
||||||
|
)]
|
||||||
} else {
|
} else {
|
||||||
BLACK
|
BLACK
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,14 @@ impl eframe::App for ComputeDraw {
|
|||||||
|
|
||||||
egui::TopBottomPanel::bottom("bottom").show(ctx, |ui| {
|
egui::TopBottomPanel::bottom("bottom").show(ctx, |ui| {
|
||||||
let wgpu_render_state = frame.wgpu_render_state().expect("missing WGPU state");
|
let wgpu_render_state = frame.wgpu_render_state().expect("missing WGPU state");
|
||||||
let image_size = wgpu_render_state.renderer.as_ref().read().callback_resources.get::<DrawResources>().unwrap().image_size;
|
let image_size = wgpu_render_state
|
||||||
|
.renderer
|
||||||
|
.as_ref()
|
||||||
|
.read()
|
||||||
|
.callback_resources
|
||||||
|
.get::<DrawResources>()
|
||||||
|
.unwrap()
|
||||||
|
.image_size;
|
||||||
|
|
||||||
ui.label(format!("Viewport: image={image_size}"))
|
ui.label(format!("Viewport: image={image_size}"))
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user