From 53d376eaeef991850d35318b147f75c8f103319d Mon Sep 17 00:00:00 2001 From: Arne Dußin Date: Sun, 27 Dec 2020 21:54:31 +0100 Subject: Change to polygongraph instead of polygon in roomtool The polygon room tool used a convoluted process for determining what the user actually wants to draw. I have changed to the polygon graph instead, which makes the checks easier and restricts the user a bit less. In the process however I found a serious problem with my handling float, so everything needed to change to margin compares (which I of course should have done in the beginning. Guys, take the warning seriously and don't ignore it for ten years like I did. It will come back to haunt you.. apparently) instead of direct equality. --- src/tool/deletion_tool.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/tool/deletion_tool.rs') diff --git a/src/tool/deletion_tool.rs b/src/tool/deletion_tool.rs index afd916a..da2090b 100644 --- a/src/tool/deletion_tool.rs +++ b/src/tool/deletion_tool.rs @@ -9,7 +9,7 @@ use super::Tool; use crate::colours::DEFAULT_COLOURS; use crate::map::Map; -use crate::math::{Rect, Surface, Vec2}; +use crate::math::{ExactSurface, Rect, Vec2}; use crate::transform::Transform; use raylib::core::drawing::{RaylibDraw, RaylibDrawHandle}; @@ -21,6 +21,7 @@ pub struct DeletionTool { impl DeletionTool { /// Create a new deletion tool, there should only be one deletion tool and it should be created /// by the editor. + #[allow(clippy::new_without_default)] pub fn new() -> Self { Self { deletion_rect: None, -- cgit v1.2.3-70-g09d2