Format code

This commit is contained in:
Maximilian Ammann 2021-12-29 10:52:17 +01:00
parent 70a4e6dae0
commit ad8260999a
3 changed files with 9 additions and 5 deletions

View File

@ -1,7 +1,7 @@
use console_error_panic_hook;
use std::cell::RefCell; use std::cell::RefCell;
use std::panic; use std::panic;
use std::rc::Rc; use std::rc::Rc;
use console_error_panic_hook;
use js_sys::Array; use js_sys::Array;
use log::{info, warn, Level}; use log::{info, warn, Level};

View File

@ -75,17 +75,21 @@ pub struct MaskInstanceUniform {
} }
impl MaskInstanceUniform { impl MaskInstanceUniform {
pub fn new(position: Vec2f32, target_width: f32, target_height: f32, debug_color: Vec4f32) -> Self { pub fn new(
position: Vec2f32,
target_width: f32,
target_height: f32,
debug_color: Vec4f32,
) -> Self {
Self { Self {
position, position,
target_width, target_width,
target_height, target_height,
debug_color debug_color,
} }
} }
} }
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone, Pod, Zeroable)] #[derive(Copy, Clone, Pod, Zeroable)]
pub struct PrimitiveUniform { pub struct PrimitiveUniform {

View File

@ -163,7 +163,7 @@ pub mod tile_mask {
// debug_color // debug_color
wgpu::VertexAttribute { wgpu::VertexAttribute {
offset: 1 * wgpu::VertexFormat::Float32x2.size() offset: 1 * wgpu::VertexFormat::Float32x2.size()
+ 2* wgpu::VertexFormat::Float32.size(), + 2 * wgpu::VertexFormat::Float32.size(),
format: wgpu::VertexFormat::Float32x4, format: wgpu::VertexFormat::Float32x4,
shader_location: 7, shader_location: 7,
}, },