From aa2341a806a2101bbc8dfc96d48766fa46c11740 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Tue, 7 Feb 2023 00:28:07 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=86=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E5=81=8F=E7=A7=BB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 以及吃了四串牛肉串 --- Difficult_Rocket/client/render/sr1_ship.py | 4 ++-- libs/Difficult_Rocket_rs/src/src/render.rs | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Difficult_Rocket/client/render/sr1_ship.py b/Difficult_Rocket/client/render/sr1_ship.py index 51ba893..3b10d82 100644 --- a/Difficult_Rocket/client/render/sr1_ship.py +++ b/Difficult_Rocket/client/render/sr1_ship.py @@ -155,8 +155,8 @@ class SR1ShipRender(BaseScreen): # render_scale = DR_option.gui_scale # 这个是 DR 的缩放比例 可以调节的( # 主要是 Windows 下有一个缩放系数嘛,我待会试试这玩意能不能获取(估计得 ctypes # 在不缩放的情况下,XML的1个单位长度对应60个像素 - render_x = part.x * 60 + self.window_pointer.width / 2 - render_y = part.y * 60 + self.window_pointer.height / 2 + render_x = part.x * 60 + render_y = part.y * 60 # 你就这里改吧 cache_sprite = Sprite(img=self.textures.get_texture(part.textures), x=render_x, y=render_y, diff --git a/libs/Difficult_Rocket_rs/src/src/render.rs b/libs/Difficult_Rocket_rs/src/src/render.rs index 1393e7c..2e6ec61 100644 --- a/libs/Difficult_Rocket_rs/src/src/render.rs +++ b/libs/Difficult_Rocket_rs/src/src/render.rs @@ -74,14 +74,18 @@ pub mod camera { let y: f64 = self.window.getattr(py, intern!(py, "height"))?.extract(py)?; let x: f64 = x / 2.0 / self.zoom + self.dx; let y: f64 = y / 2.0 / self.zoom + self.dy; + // use to get center of the screen let args = ((x * self.zoom, y * self.zoom, 0), ); let view_matrix = view.call_method1(py, intern!(py, "translate"), args)?; + // view_matrix = self.view.translate((x * zoom, y * zoom, 0)) let args = ((self.zoom, self.zoom, 1), ); let view_matrix = view_matrix.call_method1(py, intern!(py, "scale"), args)?; + // view_matrix = view_matrix.scale((zoom, zoom, 1)) self.window.setattr(py, intern!(py, "view"), view_matrix)?; + // self.view = view_matrix Ok(()) })?; return Ok(())