Merge pull request #506 from andrewcsmith/patch-2
[supercollider.git] / SCClassLibrary / Common / Geometry / Size.sc
blob745f4646fabc4fac32d81aa5149922f7758cf824
1 Size {
2         var <>width = 0, <>height = 0;
4         *new { arg width=0, height=0;
5                 ^super.newCopyArgs(width, height);
6         }
8         asSize { ^this }
10         asRect { ^Rect(0,0,width,height); }
12         asPoint { ^Point(width,height); }
14         asString {
15                 ^("Size(" ++ width ++ ", " ++ height ++ ")");
16         }
18         == { arg other;
19                 ^ other respondsTo: #[\width, \height] and: {
20                         (other.width == width) && (other.height == height)
21                 }
22         }
25 + SimpleNumber {
26         asSize { ^Size(this, this) }