mirror of
https://github.com/storytold/deckcraft.git
synced 2026-11-02 06:57:04 -06:00
docs: add missing docstrings
This commit is contained in:
@@ -13,6 +13,7 @@ struct MoveDrag {
|
||||
}
|
||||
|
||||
impl Session {
|
||||
/// Update the active drag interaction using the pointer position and modifiers.
|
||||
pub(super) fn drag(&mut self, p: Point, mods: Mods, tol: f64) -> Result<Value> {
|
||||
let Some(drag) = self.tool.drag.clone() else { return Ok(Value::Null) };
|
||||
match drag {
|
||||
|
||||
@@ -220,6 +220,7 @@ impl Session {
|
||||
}
|
||||
}
|
||||
|
||||
/// Handle a pointer press and start the applicable tool interaction.
|
||||
fn down(&mut self, p: Point, mods: Mods, tol: f64) -> Result<Value> {
|
||||
if let Some(Drag::Freeform { mode, mut points, .. }) = self.tool.drag.clone() {
|
||||
// Next click of a freeform: close on the start point, else add a vertex.
|
||||
@@ -440,6 +441,7 @@ impl Session {
|
||||
Ok(json!({"hit": serde_json::to_value(&hit).unwrap_or_default()}))
|
||||
}
|
||||
|
||||
/// Handle a pointer release and finalize the active tool interaction.
|
||||
fn up(&mut self, p: Point, mods: Mods) -> Result<Value> {
|
||||
let drag = self.tool.drag.take();
|
||||
self.tool.guides.clear();
|
||||
|
||||
Reference in New Issue
Block a user