From 48f321a80970ebeb8374072b1d2e0a4d297aa348 Mon Sep 17 00:00:00 2001 From: Arne Dußin Date: Sun, 20 Dec 2020 03:58:46 +0100 Subject: Add dimensional indicator with scaling --- src/tool/selection_tool.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/tool/selection_tool.rs') diff --git a/src/tool/selection_tool.rs b/src/tool/selection_tool.rs index 49efba9..30f91bf 100644 --- a/src/tool/selection_tool.rs +++ b/src/tool/selection_tool.rs @@ -1,9 +1,9 @@ use super::Tool; +use crate::colours::DEFAULT_COLOURS; use crate::map::Map; use crate::math::{Rect, Surface, Vec2}; use crate::transform::Transform; use raylib::core::drawing::{RaylibDraw, RaylibDrawHandle}; -use crate::colours::DEFAULT_COLOURS; pub struct SelectionTool { selection_rect: Option<(Vec2, Vec2)>, @@ -31,15 +31,8 @@ impl Tool for SelectionTool { fn draw(&self, rld: &mut RaylibDrawHandle, transform: &Transform) { if let Some((pos1, pos2)) = self.selection_rect { let rect_px = transform.rect_m_to_px(&Rect::bounding_rect(pos1, pos2)); - rld.draw_rectangle_rec( - rect_px, - DEFAULT_COLOURS.selection_rect - ); - rld.draw_rectangle_lines_ex( - rect_px, - 4, - DEFAULT_COLOURS.selection_rect_outline - ); + rld.draw_rectangle_rec(rect_px, DEFAULT_COLOURS.selection_rect); + rld.draw_rectangle_lines_ex(rect_px, 4, DEFAULT_COLOURS.selection_rect_outline); } } -- cgit v1.2.3-70-g09d2