Skip to content
Snippets Groups Projects
Verified Commit 8b733afd authored by Fabius Mettner's avatar Fabius Mettner
Browse files

Bugfix

parent a16a46e4
No related branches found
No related tags found
No related merge requests found
......@@ -70,7 +70,7 @@
<input
type="range"
min="0.25"
max="2.0"
max="1.5"
value="1.0"
step="0.01"
class="slider"
......@@ -80,7 +80,7 @@
<input
type="range"
min="0"
max="7"
max="1"
value="0"
step="0.01"
class="slider"
......
use std::f32::consts::PI;
use image::{GrayImage, Luma};
use imageproc::geometric_transformations::{rotate_about_center, Interpolation};
use wasm_bindgen::prelude::*;
......@@ -215,8 +217,6 @@ impl ImageState {
}*/
pub fn resize_0(&mut self, scale: u32) {
self.width = 256;
self.height = 256;
match &mut self.form0 {
Form::None => {}
Form::Square(s, _) => *s = scale,
......@@ -244,8 +244,6 @@ impl ImageState {
}
pub fn resize_1(&mut self, scale: u32) {
self.width = 256;
self.height = 256;
match &mut self.form1 {
Form::None => {}
Form::Square(s, _) => *s = scale,
......@@ -278,7 +276,7 @@ impl ImageState {
}
pub fn rotate(&mut self, rotation: f32) {
self.rotate = rotation;
self.rotate = rotation * 2.0 * PI;
self.display();
}
......
@vertex
fn vs_main(@builtin(vertex_index) vertex_index: u32) -> @builtin(position) vec4<f32> {
var positions = array<vec2<f32>, 6>(
vec2<f32>(-0.5, -0.5),
vec2<f32>(0.5, -0.5),
vec2<f32>(0.5, 0.5),
vec2<f32>(-0.5, -0.5),
vec2<f32>(0.5, 0.5),
vec2<f32>(-0.5, 0.5)
);
let pos = positions[vertex_index];
return vec4<f32>(pos, 0.0, 1.0);
}
@fragment
fn fs_main() -> @location(0) vec4<f32> {
return vec4<f32>(1.0, 1.0, 1.0, 1.0); // White square
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment