diff options
Diffstat (limited to 'src/tool/selection_tool.rs')
| -rw-r--r-- | src/tool/selection_tool.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tool/selection_tool.rs b/src/tool/selection_tool.rs index 30f91bf..c790734 100644 --- a/src/tool/selection_tool.rs +++ b/src/tool/selection_tool.rs @@ -1,3 +1,11 @@ +//! Selection of items on the map. +//! +//! When selecting items on the map, the editor goes into a different mode than when editing a +//! specific kind of item. Actions that are available for specific types of items become +//! unavailable, while other actions that make use of the properties to a wide range of items +//! become available instead. +//! For this reason, the selection tool can be thought of as a kind of meta tool over tools. + 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 selection tool makes it possible to select any item on the map when activated. pub struct SelectionTool { selection_rect: Option<(Vec2<f64>, Vec2<f64>)>, } impl SelectionTool { + /// Create a new selection tool. There should be only one such tool per program instance and it + /// should be created in the editor. pub fn new() -> Self { Self { selection_rect: None, |
