Fix issue with tooltip location

This commit is contained in:
Timothy Warren 2022-01-04 13:34:38 -05:00
parent a5d3adadeb
commit 8824faff24

View File

@ -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::<Pools>();
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