aboutsummaryrefslogtreecommitdiff
path: root/src/tool/selection_tool.rs
diff options
context:
space:
mode:
authorArne Dußin2020-12-21 01:22:15 +0100
committerArne Dußin2020-12-21 21:15:55 +0100
commitd7e9c3cc46d616c2fcd1a6e9f73adbb79c6570b4 (patch)
treee5633f4d3b18472922c943d759e9f58722ba4405 /src/tool/selection_tool.rs
parent48f321a80970ebeb8374072b1d2e0a4d297aa348 (diff)
downloadgraf_karto-d7e9c3cc46d616c2fcd1a6e9f73adbb79c6570b4.tar.gz
graf_karto-d7e9c3cc46d616c2fcd1a6e9f73adbb79c6570b4.zip
Add previously missing docs where appropriate
Diffstat (limited to 'src/tool/selection_tool.rs')
-rw-r--r--src/tool/selection_tool.rs11
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,