This commit is contained in:
Ebu
2025-12-02 14:19:25 +01:00
parent d6894d20b7
commit d8e9e12515

View File

@@ -186,8 +186,8 @@ impl WindowHandler for PluginGui {
let freshener_image_source_rect = Rect {
x: self.freshener_screen_bounds.x - frame_x * FRESHENER_FRAME_WIDTH,
y: self.freshener_screen_bounds.y - frame_y * FRESHENER_FRAME_HEIGHT,
width: FRESHENER_FRAME_WIDTH * FRESHENER_FRAMES_X as f32,
height: FRESHENER_FRAME_HEIGHT * FRESHENER_FRAMES_Y as f32,
width: FRESHENER_FRAME_WIDTH * FRESHENER_FRAMES_X as f32 * scaling_factor,
height: FRESHENER_FRAME_HEIGHT * FRESHENER_FRAMES_Y as f32 * scaling_factor,
};
if let Ok(not_so_fresh) = self.not_so_fresh_image {
@@ -282,6 +282,7 @@ impl WindowHandler for PluginGui {
event: baseview::Event,
) -> baseview::EventStatus {
let setter = ParamSetter::new(self._gui_context.as_ref());
let scaling_factor = self.scaling_factor();
match event {
Event::Window(WindowEvent::Resized(size)) => {
let phys_size = size.physical_size();
@@ -295,7 +296,7 @@ impl WindowHandler for PluginGui {
self.dirty = true;
}
Event::Mouse(MouseEvent::CursorMoved { position, .. }) => {
self.mouse_position = (position.x as f32, position.y as f32);
self.mouse_position = (position.x as f32 / scaling_factor, position.y as f32 / scaling_factor);
if self.dragging {
let delta = self.mouse_position.1 - self.drag_start_mouse_pos.1;
let new_value =