diff options
| author | Arne Dußin | 2020-12-20 03:58:46 +0100 |
|---|---|---|
| committer | Arne Dußin | 2020-12-20 16:41:52 +0100 |
| commit | 48f321a80970ebeb8374072b1d2e0a4d297aa348 (patch) | |
| tree | 8f6dbffef7ed507ae118919917fd69a7a9528c39 /src/tool/selection_tool.rs | |
| parent | c073618d9773216ab4a2dcd7944589f38b1df751 (diff) | |
| download | graf_karto-48f321a80970ebeb8374072b1d2e0a4d297aa348.tar.gz graf_karto-48f321a80970ebeb8374072b1d2e0a4d297aa348.zip | |
Add dimensional indicator with scaling
Diffstat (limited to 'src/tool/selection_tool.rs')
| -rw-r--r-- | src/tool/selection_tool.rs | 13 |
1 files changed, 3 insertions, 10 deletions
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<f64>, Vec2<f64>)>, @@ -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); } } |
