diff options
| author | Arne Dußin | 2020-12-21 01:22:15 +0100 |
|---|---|---|
| committer | Arne Dußin | 2020-12-21 21:15:55 +0100 |
| commit | d7e9c3cc46d616c2fcd1a6e9f73adbb79c6570b4 (patch) | |
| tree | e5633f4d3b18472922c943d759e9f58722ba4405 /src/tool/deletion_tool.rs | |
| parent | 48f321a80970ebeb8374072b1d2e0a4d297aa348 (diff) | |
| download | graf_karto-d7e9c3cc46d616c2fcd1a6e9f73adbb79c6570b4.tar.gz graf_karto-d7e9c3cc46d616c2fcd1a6e9f73adbb79c6570b4.zip | |
Add previously missing docs where appropriate
Diffstat (limited to 'src/tool/deletion_tool.rs')
| -rw-r--r-- | src/tool/deletion_tool.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tool/deletion_tool.rs b/src/tool/deletion_tool.rs index cd38f6c..afd916a 100644 --- a/src/tool/deletion_tool.rs +++ b/src/tool/deletion_tool.rs @@ -1,3 +1,11 @@ +//! A meta tool for selecting parts of a map and removing them in a single operation. +//! +//! The user can draw a rectangle, which currently must have it's side parallel to the x and y-axes +//! of the world. With the first node placement, the mode is started, while the second placement would +//! finish the process and delete all elements that are *completely* contained in the rectangle +//! (partially contained items are not deleted) or abort it, in which case the selection is removed +//! and nothing is deleted. + use super::Tool; use crate::colours::DEFAULT_COLOURS; use crate::map::Map; @@ -5,11 +13,14 @@ use crate::math::{Rect, Surface, Vec2}; use crate::transform::Transform; use raylib::core::drawing::{RaylibDraw, RaylibDrawHandle}; +/// The deletion tool itself. pub struct DeletionTool { deletion_rect: Option<(Vec2<f64>, Vec2<f64>)>, } impl DeletionTool { + /// Create a new deletion tool, there should only be one deletion tool and it should be created + /// by the editor. pub fn new() -> Self { Self { deletion_rect: None, |
