diff options
| author | Arne Dußin | 2020-12-21 21:12:01 +0100 |
|---|---|---|
| committer | GitHub | 2020-12-21 21:12:01 +0100 |
| commit | c435f278eddcada279fdc424120e4a1448843c20 (patch) | |
| tree | be9a5601e99608966d4ccd146c3bfb3a70c7fc02 /src/scaleable.rs | |
| parent | 3bc690803fb59493ea8180fd630d65b3e26642d0 (diff) | |
| parent | 82d11b7d3e15d8175accf7579db1fbe528fc6583 (diff) | |
| download | graf_karto-c435f278eddcada279fdc424120e4a1448843c20.tar.gz graf_karto-c435f278eddcada279fdc424120e4a1448843c20.zip | |
Merge pull request #24 from LordSentox/refactor
Refactor to make interaction between tools easier
Diffstat (limited to 'src/scaleable.rs')
| -rw-r--r-- | src/scaleable.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/scaleable.rs b/src/scaleable.rs new file mode 100644 index 0000000..450e61e --- /dev/null +++ b/src/scaleable.rs @@ -0,0 +1,11 @@ +use crate::math::Vec2; + +/// Trait representing something that covers an area and that can be resized accordingly. +pub trait Scaleable { + /// Scale the object by the specified amount in horizontal and vertical direction (right and + /// downwards). + /// + /// # Panics + /// If at least one of the dimensions is zero or less, the object cannot be scaled and panics. + fn scale(&mut self, by: &Vec2<f64>); +} |
