From 8824faff24988426958f44b38257d741083584ea Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Tue, 4 Jan 2022 13:34:38 -0500 Subject: [PATCH] Fix issue with tooltip location --- src/gui.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui.rs b/src/gui.rs index 2e373ca..9648f06 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -2,8 +2,8 @@ use ::rltk::{Point, Rltk, VirtualKeyCode, RGB}; use ::specs::prelude::*; use crate::components::{ - Attribute, Attributes, Consumable, HungerClock, HungerState, InBackpack, Name, Player, Pools, - Position, Viewshed, + Attribute, Attributes, Consumable, HungerClock, HungerState, InBackpack, Name, Pools, Position, + Viewshed, }; use crate::game_log::GameLog; use crate::rex_assets::RexAssets; @@ -240,9 +240,9 @@ fn draw_tooltips(ecs: &World, ctx: &mut Rltk) { let pools = ecs.read_storage::(); let entities = ecs.entities(); let mouse_pos = ctx.mouse_pos(); - let mut mouse_map_pos = mouse_pos.clone(); - mouse_map_pos.0 += min_x - 1; - mouse_map_pos.1 += min_y - 1; + let mut mouse_map_pos = mouse_pos; + mouse_map_pos.0 += min_x; + mouse_map_pos.1 += min_y; if mouse_map_pos.0 >= map.width - 1 || mouse_map_pos.1 >= map.height - 1