From 84005c5dd0e4cba7754388244668ee327ca89aa1 Mon Sep 17 00:00:00 2001 From: TerraMaster85 Date: Thu, 13 Apr 2023 09:06:05 -0400 Subject: [PATCH] =?UTF-8?q?regress=20to=20Shift=20'n'=20Sketch=E2=84=A2=20?= =?UTF-8?q?rendering=20(hopefully=20last=20fix)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/rendering/renderer.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/client/src/rendering/renderer.rs b/client/src/rendering/renderer.rs index 2d95bd7ca8602f1c1560158fe1f3aea41ac8b194..ecfeb518533d25109660884165efb63056d9121b 100644 --- a/client/src/rendering/renderer.rs +++ b/client/src/rendering/renderer.rs @@ -67,6 +67,8 @@ impl Renderer for WebRenderer { context.save(); //context.translate(player.x, player.y).map_err(|e: JsValue| e.as_string().unwrap())?; + //gaah fuck why noo i didnt want this. godforsaken canvas rotation + context.translate(player.x - client.x, player.y - client.y).map_err(|e: JsValue| e.as_string().unwrap())?; // fwip context.set_text_align("center"); context.set_font("30px Segoe UI"); @@ -77,18 +79,14 @@ impl Renderer for WebRenderer { let texture_image = document.get_element_by_id("tex-hearty").unwrap().dyn_into::().unwrap(); debug!("H {} {}", player.x - 25f64 - client.x, player.y - 25f64 - client.y); - context.draw_image_with_html_image_element_and_dw_and_dh(&texture_image, player.x - 25f64 - client.x, player.y - 25f64 - client.y, 50f64, 50f64).map_err(|e: JsValue| e.as_string().unwrap())?; // sktch + //context.draw_image_with_html_image_element_and_dw_and_dh(&texture_image, player.x - 25f64 - client.x, player.y - 25f64 - client.y, 50f64, 50f64).map_err(|e: JsValue| e.as_string().unwrap())?; + context.draw_image_with_html_image_element_and_dw_and_dh(&texture_image, -25f64, -25f64, 50f64, 50f64).map_err(|e: JsValue| e.as_string().unwrap())?; // sktch //context.rotate(-player.rotation).map_err(|e: JsValue| e.as_string().unwrap())?; // fwoop context.restore(); } - context.scale(0.25f64, 0.25f64).map_err(|e: JsValue| e.as_string().unwrap())?; - - // do not remove - // im making this smiley an easter egg soon - // i just have to go fix the broken build system first /* context.begin_path();