source: main/trunk/model-sites-dev/von-sparql/js/paper/docs/classes/Size.html@ 28914

Last change on this file since 28914 was 28914, checked in by ak19, 10 years ago

Supporting javascript libraries and bespoke code written by Steffan to support the von-sparql user interface

File size: 20.2 KB
Line 
1<!DOCTYPE html>
2<html>
3<head>
4<meta charset="UTF-8">
5<title>Size</title>
6<base target="class-frame">
7<link href="../assets/css/docs.css" rel="stylesheet" type="text/css">
8<script src="../assets/js/paper.js"></script>
9<script src="../assets/js/jquery.js"></script>
10<script src="../assets/js/codemirror.js"></script>
11<script src="../assets/js/docs.js"></script>
12</head>
13<body class="reference">
14<div class="reference-class">
15<h1>Size</h1>
16
17<p>The Size object is used to describe the size or dimensions of
18somethign, through its <a href="../classes/Size.html#width" onclick="return toggleMember('width', true);"><tt>width</tt></a> and <a href="../classes/Size.html#height" onclick="return toggleMember('height', true);"><tt>height</tt></a> properties.</p>
19<p>
20<b>Example</b> &mdash; Create a size that is 10pt wide and 5pt high, and use it to define a rectangle:
21</p>
22
23
24<pre class="code">var size = new Size(10, 5);
25console.log(size.width); // 10
26console.log(size.height); // 5
27var rect = new Rectangle(new Point(20, 15), size);
28console.log(rect); // { x: 20, y: 15, width: 10, height: 5 }</pre>
29
30</div>
31
32<!-- ============================== constructors ========================= -->
33<div class="reference-members"><h2>Constructors</h2>
34
35
36<div id="size-width-height" class="member">
37<div class="member-link">
38<a name="size-width-height" href="#size-width-height"><tt><b>Size</b>(width, height)</tt></a>
39</div>
40<div class="member-description hidden">
41<div class="member-text">
42<p>Creates a Size object with the given width and height values.</p>
43
44<ul><b>Parameters:</b>
45
46<li>
47<tt>width:</tt>
48<tt>Number</tt>
49&mdash;&nbsp;the width
50
51</li>
52
53<li>
54<tt>height:</tt>
55<tt>Number</tt>
56&mdash;&nbsp;the height
57
58</li>
59
60</ul>
61
62
63<p>
64<b>Example</b> &mdash; Create a size that is 10pt wide and 5pt high
65</p>
66
67
68<pre class="code">var size = new Size(10, 5);
69console.log(size.width); // 10
70console.log(size.height); // 5</pre>
71
72
73</div>
74</div>
75</div>
76
77
78<div id="size-array" class="member">
79<div class="member-link">
80<a name="size-array" href="#size-array"><tt><b>Size</b>(array)</tt></a>
81</div>
82<div class="member-description hidden">
83<div class="member-text">
84<p>Creates a Size object using the numbers in the given array as
85dimensions.</p>
86
87<ul><b>Parameters:</b>
88
89<li>
90<tt>array:</tt>
91<tt>Array</tt>
92
93
94</li>
95
96</ul>
97
98
99<p>
100<b>Example</b> &mdash; Creating a size of width: 320, height: 240 using an array of numbers:
101</p>
102
103
104<pre class="code">var array = [320, 240];
105var size = new Size(array);
106console.log(size.width); // 320
107console.log(size.height); // 240</pre>
108
109
110</div>
111</div>
112</div>
113
114
115<div id="size-object" class="member">
116<div class="member-link">
117<a name="size-object" href="#size-object"><tt><b>Size</b>(object)</tt></a>
118</div>
119<div class="member-description hidden">
120<div class="member-text">
121<p>Creates a Size object using the properties in the given object.</p>
122
123<ul><b>Parameters:</b>
124
125<li>
126<tt>object:</tt>
127<tt>Object</tt>
128
129
130</li>
131
132</ul>
133
134
135<p>
136<b>Example</b> &mdash; Creating a size of width: 10, height: 20 using an object literal:
137</p>
138
139
140<pre class="code">var size = new Size({
141 width: 10,
142 height: 20
143});
144console.log(size.width); // 10
145console.log(size.height); // 20</pre>
146
147
148</div>
149</div>
150</div>
151
152
153<div id="size-size" class="member">
154<div class="member-link">
155<a name="size-size" href="#size-size"><tt><b>Size</b>(size)</tt></a>
156</div>
157<div class="member-description hidden">
158<div class="member-text">
159<p>Creates a Size object using the coordinates of the given Size object.</p>
160
161<ul><b>Parameters:</b>
162
163<li>
164<tt>size:</tt>
165<a href="../classes/Size.html"><tt>Size</tt></a>
166
167
168</li>
169
170</ul>
171
172
173
174
175</div>
176</div>
177</div>
178
179
180<div id="size-point" class="member">
181<div class="member-link">
182<a name="size-point" href="#size-point"><tt><b>Size</b>(point)</tt></a>
183</div>
184<div class="member-description hidden">
185<div class="member-text">
186<p>Creates a Size object using the <a href="../classes/Point.html#x"><tt>point.x</tt></a> and <a href="../classes/Point.html#y"><tt>point.y</tt></a>
187values of the given Point object.</p>
188
189<ul><b>Parameters:</b>
190
191<li>
192<tt>point:</tt>
193<a href="../classes/Point.html"><tt>Point</tt></a>
194
195
196</li>
197
198</ul>
199
200
201<p>
202<b>Example</b>
203</p>
204
205
206<pre class="code">var point = new Point(50, 50);
207var size = new Size(point);
208console.log(size.width); // 50
209console.log(size.height); // 50</pre>
210
211
212</div>
213</div>
214</div>
215
216</div>
217
218
219
220<!-- ============================== properties ========================= -->
221 <div class="reference-members"><h2>Operators</h2>
222
223 <div id="add" class="member">
224<div class="member-link">
225<a name="add" href="#add"><tt><tt><b>+</b> Number</tt>, <tt><b>+</b> Size</tt></tt></a>
226</div>
227<div class="member-description hidden">
228
229
230 <div class="member-text">
231 <p>Returns the addition of the supplied value to the width and height of the
232size as a new size. The object itself is not modified!</p>
233
234 <ul><b>Returns:</b>
235
236 <li>
237<tt><a href="../classes/Size.html"><tt>Size</tt></a></tt>&nbsp;&mdash;&nbsp;the addition of the size and the value as a new size
238</li>
239
240 </ul>
241
242
243 <p>
244<b>Example</b>
245</p>
246
247
248<pre class="code">var size = new Size(5, 10);
249var result = size + 20;
250console.log(result); // {width: 25, height: 30}</pre>
251
252 </div>
253
254
255
256 <div class="member-text">
257 <p>Returns the addition of the width and height of the supplied size to the
258size as a new size. The object itself is not modified!</p>
259
260 <ul><b>Returns:</b>
261
262 <li>
263<tt><a href="../classes/Size.html"><tt>Size</tt></a></tt>&nbsp;&mdash;&nbsp;the addition of the two sizes as a new size
264</li>
265
266 </ul>
267
268
269 <p>
270<b>Example</b>
271</p>
272
273
274<pre class="code">var size1 = new Size(5, 10);
275var size2 = new Size(10, 20);
276var result = size1 + size2;
277console.log(result); // {width: 15, height: 30}</pre>
278
279 </div>
280
281
282</div>
283</div>
284
285
286 <div id="subtract" class="member">
287<div class="member-link">
288<a name="subtract" href="#subtract"><tt><tt><b>-</b> Number</tt>, <tt><b>-</b> Size</tt></tt></a>
289</div>
290<div class="member-description hidden">
291
292
293 <div class="member-text">
294 <p>Returns the subtraction of the supplied value from the width and height
295of the size as a new size. The object itself is not modified!</p>
296<p>The object itself is not modified!</p>
297
298 <ul><b>Returns:</b>
299
300 <li>
301<tt><a href="../classes/Size.html"><tt>Size</tt></a></tt>&nbsp;&mdash;&nbsp;the subtraction of the size and the value as a new size
302</li>
303
304 </ul>
305
306
307 <p>
308<b>Example</b>
309</p>
310
311
312<pre class="code">var size = new Size(10, 20);
313var result = size - 5;
314console.log(result); // {width: 5, height: 15}</pre>
315
316 </div>
317
318
319
320 <div class="member-text">
321 <p>Returns the subtraction of the width and height of the supplied size from
322the size as a new size. The object itself is not modified!</p>
323
324 <ul><b>Returns:</b>
325
326 <li>
327<tt><a href="../classes/Size.html"><tt>Size</tt></a></tt>&nbsp;&mdash;&nbsp;the subtraction of the two sizes as a new size
328</li>
329
330 </ul>
331
332
333 <p>
334<b>Example</b>
335</p>
336
337
338<pre class="code">var firstSize = new Size(10, 20);
339var secondSize = new Size(5, 5);
340var result = firstSize - secondSize;
341console.log(result); // {width: 5, height: 15}</pre>
342
343 </div>
344
345
346</div>
347</div>
348
349
350 <div id="multiply" class="member">
351<div class="member-link">
352<a name="multiply" href="#multiply"><tt><tt><b>*</b> Number</tt>, <tt><b>*</b> Size</tt></tt></a>
353</div>
354<div class="member-description hidden">
355
356
357 <div class="member-text">
358 <p>Returns the multiplication of the supplied value with the width and
359height of the size as a new size. The object itself is not modified!</p>
360
361 <ul><b>Returns:</b>
362
363 <li>
364<tt><a href="../classes/Size.html"><tt>Size</tt></a></tt>&nbsp;&mdash;&nbsp;the multiplication of the size and the value as a new size
365</li>
366
367 </ul>
368
369
370 <p>
371<b>Example</b>
372</p>
373
374
375<pre class="code">var size = new Size(10, 20);
376var result = size * 2;
377console.log(result); // {width: 20, height: 40}</pre>
378
379 </div>
380
381
382
383 <div class="member-text">
384 <p>Returns the multiplication of the width and height of the supplied size
385with the size as a new size. The object itself is not modified!</p>
386
387 <ul><b>Returns:</b>
388
389 <li>
390<tt><a href="../classes/Size.html"><tt>Size</tt></a></tt>&nbsp;&mdash;&nbsp;the multiplication of the two sizes as a new size
391</li>
392
393 </ul>
394
395
396 <p>
397<b>Example</b>
398</p>
399
400
401<pre class="code">var firstSize = new Size(5, 10);
402var secondSize = new Size(4, 2);
403var result = firstSize * secondSize;
404console.log(result); // {width: 20, height: 20}</pre>
405
406 </div>
407
408
409</div>
410</div>
411
412
413 <div id="divide" class="member">
414<div class="member-link">
415<a name="divide" href="#divide"><tt><tt><b>/</b> Number</tt>, <tt><b>/</b> Size</tt></tt></a>
416</div>
417<div class="member-description hidden">
418
419
420 <div class="member-text">
421 <p>Returns the division of the supplied value by the width and height of the
422size as a new size. The object itself is not modified!</p>
423
424 <ul><b>Returns:</b>
425
426 <li>
427<tt><a href="../classes/Size.html"><tt>Size</tt></a></tt>&nbsp;&mdash;&nbsp;the division of the size and the value as a new size
428</li>
429
430 </ul>
431
432
433 <p>
434<b>Example</b>
435</p>
436
437
438<pre class="code">var size = new Size(10, 20);
439var result = size / 2;
440console.log(result); // {width: 5, height: 10}</pre>
441
442 </div>
443
444
445
446 <div class="member-text">
447 <p>Returns the division of the width and height of the supplied size by the
448size as a new size. The object itself is not modified!</p>
449
450 <ul><b>Returns:</b>
451
452 <li>
453<tt><a href="../classes/Size.html"><tt>Size</tt></a></tt>&nbsp;&mdash;&nbsp;the division of the two sizes as a new size
454</li>
455
456 </ul>
457
458
459 <p>
460<b>Example</b>
461</p>
462
463
464<pre class="code">var firstSize = new Size(8, 10);
465var secondSize = new Size(2, 5);
466var result = firstSize / secondSize;
467console.log(result); // {width: 4, height: 2}</pre>
468
469 </div>
470
471
472</div>
473</div>
474
475
476 <div id="modulo" class="member">
477<div class="member-link">
478<a name="modulo" href="#modulo"><tt><tt><b>%</b> Number</tt>, <tt><b>%</b> Size</tt></tt></a>
479</div>
480<div class="member-description hidden">
481
482
483 <div class="member-text">
484 <p>The modulo operator returns the integer remainders of dividing the size
485by the supplied value as a new size.</p>
486
487 <ul><b>Returns:</b>
488
489 <li>
490<tt><a href="../classes/Size.html"><tt>Size</tt></a></tt>&nbsp;&mdash;&nbsp;the integer remainders of dividing the size by the value
491 as a new size
492</li>
493
494 </ul>
495
496
497 <p>
498<b>Example</b>
499</p>
500
501
502<pre class="code">var size = new Size(12, 6);
503console.log(size % 5); // {width: 2, height: 1}</pre>
504
505 </div>
506
507
508
509 <div class="member-text">
510 <p>The modulo operator returns the integer remainders of dividing the size
511by the supplied size as a new size.</p>
512
513 <ul><b>Returns:</b>
514
515 <li>
516<tt><a href="../classes/Size.html"><tt>Size</tt></a></tt>&nbsp;&mdash;&nbsp;the integer remainders of dividing the sizes by each
517 other as a new size
518</li>
519
520 </ul>
521
522
523 <p>
524<b>Example</b>
525</p>
526
527
528<pre class="code">var size = new Size(12, 6);
529console.log(size % new Size(5, 2)); // {width: 2, height: 0}</pre>
530
531 </div>
532
533
534</div>
535</div>
536
537
538 </div>
539
540
541
542 <div class="reference-members"><h2>Properties</h2>
543
544
545<div id="width" class="member">
546<div class="member-link">
547<a name="width" href="#width"><tt><b>width</b></tt></a>
548</div>
549<div class="member-description hidden">
550
551<div class="member-text">
552 <p>The width of the size</p>
553
554
555 <ul><b>Type:</b>
556 <li>
557 <tt>Number</tt>
558 </li>
559 </ul>
560
561
562</div>
563
564</div>
565</div>
566
567
568<div id="height" class="member">
569<div class="member-link">
570<a name="height" href="#height"><tt><b>height</b></tt></a>
571</div>
572<div class="member-description hidden">
573
574<div class="member-text">
575 <p>The height of the size</p>
576
577
578 <ul><b>Type:</b>
579 <li>
580 <tt>Number</tt>
581 </li>
582 </ul>
583
584
585</div>
586
587</div>
588</div>
589
590 </div>
591
592
593
594<!-- ============================== methods ================================ -->
595 <div class="reference-members"><h2>Methods</h2>
596
597
598<div id="equals-" class="member">
599<div class="member-link">
600<a name="equals-" href="#equals-"><tt><b>equals</b>()</tt></a>
601</div>
602<div class="member-description hidden">
603<div class="member-text">
604 <p>Checks whether the width and height of the size are equal to those of the
605supplied size.</p>
606
607<ul><b>Parameters:</b>
608
609<li>
610<tt>:</tt>
611<a href="../classes/Size.html"><tt>Size</tt></a>
612
613
614</li>
615
616</ul>
617
618
619 <ul><b>Returns:</b>
620
621 <li>
622<tt><tt>Boolean</tt></tt>
623</li>
624
625 </ul>
626
627
628 <p>
629<b>Example</b>
630</p>
631
632
633<pre class="code">var size = new Size(5, 10);
634console.log(size == new Size(5, 10)); // true
635console.log(size == new Size(1, 1)); // false
636console.log(size != new Size(1, 1)); // true</pre>
637
638</div>
639</div>
640</div>
641
642
643<div id="clone" class="member">
644<div class="member-link">
645<a name="clone" href="#clone"><tt><b>clone</b>()</tt></a>
646</div>
647<div class="member-description hidden">
648<div class="member-text">
649 <p>Returns a copy of the size.</p>
650
651
652
653
654</div>
655</div>
656</div>
657
658
659<div id="tostring" class="member">
660<div class="member-link">
661<a name="tostring" href="#tostring"><tt><b>toString</b>()</tt></a>
662</div>
663<div class="member-description hidden">
664<div class="member-text">
665
666
667
668 <ul><b>Returns:</b>
669
670 <li>
671<tt><tt>String</tt></tt>&nbsp;&mdash;&nbsp;a string representation of the size
672</li>
673
674 </ul>
675
676
677
678</div>
679</div>
680</div>
681
682
683<h3>Tests</h3>
684
685<div id="iszero" class="member">
686<div class="member-link">
687<a name="iszero" href="#iszero"><tt><b>isZero</b>()</tt></a>
688</div>
689<div class="member-description hidden">
690<div class="member-text">
691 <p>Checks if this size has both the width and height set to 0.</p>
692
693
694 <ul><b>Returns:</b>
695
696 <li>
697<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> both width and height are 0, <tt>false</tt> otherwise
698</li>
699
700 </ul>
701
702
703
704</div>
705</div>
706</div>
707
708
709<div id="isnan" class="member">
710<div class="member-link">
711<a name="isnan" href="#isnan"><tt><b>isNaN</b>()</tt></a>
712</div>
713<div class="member-description hidden">
714<div class="member-text">
715 <p>Checks if the width or the height of the size are NaN.</p>
716
717
718 <ul><b>Returns:</b>
719
720 <li>
721<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the width or height of the size are NaN, <tt>false</tt> otherwise
722</li>
723
724 </ul>
725
726
727
728</div>
729</div>
730</div>
731
732
733<h3>Math Functions</h3>
734
735<div id="round" class="member">
736<div class="member-link">
737<a name="round" href="#round"><tt><b>round</b>()</tt></a>
738</div>
739<div class="member-description hidden">
740<div class="member-text">
741 <p>Returns a new size with rounded <a href="../classes/Size.html#width" onclick="return toggleMember('width', true);"><tt>width</tt></a> and <a href="../classes/Size.html#height" onclick="return toggleMember('height', true);"><tt>height</tt></a>
742values. The object itself is not modified!</p>
743
744
745 <ul><b>Returns:</b>
746
747 <li>
748<tt><a href="../classes/Size.html"><tt>Size</tt></a></tt>
749</li>
750
751 </ul>
752
753
754 <p>
755<b>Example</b>
756</p>
757
758
759<pre class="code">var size = new Size(10.2, 10.9);
760var roundSize = size.round();
761console.log(roundSize); // {x: 10, y: 11}</pre>
762
763</div>
764</div>
765</div>
766
767
768<div id="ceil" class="member">
769<div class="member-link">
770<a name="ceil" href="#ceil"><tt><b>ceil</b>()</tt></a>
771</div>
772<div class="member-description hidden">
773<div class="member-text">
774 <p>Returns a new size with the nearest greater non-fractional values to the
775specified <a href="../classes/Size.html#width" onclick="return toggleMember('width', true);"><tt>width</tt></a> and <a href="../classes/Size.html#height" onclick="return toggleMember('height', true);"><tt>height</tt></a> values. The object itself is
776not modified!</p>
777
778
779 <ul><b>Returns:</b>
780
781 <li>
782<tt><a href="../classes/Size.html"><tt>Size</tt></a></tt>
783</li>
784
785 </ul>
786
787
788 <p>
789<b>Example</b>
790</p>
791
792
793<pre class="code">var size = new Size(10.2, 10.9);
794var ceilSize = size.ceil();
795console.log(ceilSize); // {x: 11, y: 11}</pre>
796
797</div>
798</div>
799</div>
800
801
802<div id="floor" class="member">
803<div class="member-link">
804<a name="floor" href="#floor"><tt><b>floor</b>()</tt></a>
805</div>
806<div class="member-description hidden">
807<div class="member-text">
808 <p>Returns a new size with the nearest smaller non-fractional values to the
809specified <a href="../classes/Size.html#width" onclick="return toggleMember('width', true);"><tt>width</tt></a> and <a href="../classes/Size.html#height" onclick="return toggleMember('height', true);"><tt>height</tt></a> values. The object itself is
810not modified!</p>
811
812
813 <ul><b>Returns:</b>
814
815 <li>
816<tt><a href="../classes/Size.html"><tt>Size</tt></a></tt>
817</li>
818
819 </ul>
820
821
822 <p>
823<b>Example</b>
824</p>
825
826
827<pre class="code">var size = new Size(10.2, 10.9);
828var floorSize = size.floor();
829console.log(floorSize); // {x: 10, y: 10}</pre>
830
831</div>
832</div>
833</div>
834
835
836<div id="abs" class="member">
837<div class="member-link">
838<a name="abs" href="#abs"><tt><b>abs</b>()</tt></a>
839</div>
840<div class="member-description hidden">
841<div class="member-text">
842 <p>Returns a new size with the absolute values of the specified
843<a href="../classes/Size.html#width" onclick="return toggleMember('width', true);"><tt>width</tt></a> and <a href="../classes/Size.html#height" onclick="return toggleMember('height', true);"><tt>height</tt></a> values. The object itself is not
844modified!</p>
845
846
847 <ul><b>Returns:</b>
848
849 <li>
850<tt><a href="../classes/Size.html"><tt>Size</tt></a></tt>
851</li>
852
853 </ul>
854
855
856 <p>
857<b>Example</b>
858</p>
859
860
861<pre class="code">var size = new Size(-5, 10);
862var absSize = size.abs();
863console.log(absSize); // {x: 5, y: 10}</pre>
864
865</div>
866</div>
867</div>
868
869 </div>
870
871
872 <div class="reference-members"><h2>Static Methods</h2>
873
874
875<div id="min-size1-size2" class="member">
876<div class="member-link">
877<a name="min-size1-size2" href="#min-size1-size2"><tt><b>Size.min</b>(size1, size2)</tt></a>
878</div>
879<div class="member-description hidden">
880<div class="member-text">
881 <p>Returns a new size object with the smallest <a href="../classes/Size.html#width" onclick="return toggleMember('width', true);"><tt>width</tt></a> and
882<a href="../classes/Size.html#height" onclick="return toggleMember('height', true);"><tt>height</tt></a> of the supplied sizes.</p>
883
884<ul><b>Parameters:</b>
885
886<li>
887<tt>size1:</tt>
888<a href="../classes/Size.html"><tt>Size</tt></a>
889
890
891</li>
892
893<li>
894<tt>size2:</tt>
895<a href="../classes/Size.html"><tt>Size</tt></a>
896
897
898</li>
899
900</ul>
901
902
903 <ul><b>Returns:</b>
904
905 <li>
906<tt><a href="../classes/Size.html"><tt>Size</tt></a></tt>&nbsp;&mdash;&nbsp;the newly created size object
907</li>
908
909 </ul>
910
911
912 <p>
913<b>Example</b>
914</p>
915
916
917<pre class="code">var size1 = new Size(10, 100);
918var size2 = new Size(200, 5);
919var minSize = Size.min(size1, size2);
920console.log(minSize); // {width: 10, height: 5}</pre>
921
922</div>
923</div>
924</div>
925
926
927<div id="max-size1-size2" class="member">
928<div class="member-link">
929<a name="max-size1-size2" href="#max-size1-size2"><tt><b>Size.max</b>(size1, size2)</tt></a>
930</div>
931<div class="member-description hidden">
932<div class="member-text">
933 <p>Returns a new size object with the largest <a href="../classes/Size.html#width" onclick="return toggleMember('width', true);"><tt>width</tt></a> and
934<a href="../classes/Size.html#height" onclick="return toggleMember('height', true);"><tt>height</tt></a> of the supplied sizes.</p>
935
936<ul><b>Parameters:</b>
937
938<li>
939<tt>size1:</tt>
940<a href="../classes/Size.html"><tt>Size</tt></a>
941
942
943</li>
944
945<li>
946<tt>size2:</tt>
947<a href="../classes/Size.html"><tt>Size</tt></a>
948
949
950</li>
951
952</ul>
953
954
955 <ul><b>Returns:</b>
956
957 <li>
958<tt><a href="../classes/Size.html"><tt>Size</tt></a></tt>&nbsp;&mdash;&nbsp;the newly created size object
959</li>
960
961 </ul>
962
963
964 <p>
965<b>Example</b>
966</p>
967
968
969<pre class="code">var size1 = new Size(10, 100);
970var size2 = new Size(200, 5);
971var maxSize = Size.max(size1, size2);
972console.log(maxSize); // {width: 200, height: 100}</pre>
973
974</div>
975</div>
976</div>
977
978
979<div id="random" class="member">
980<div class="member-link">
981<a name="random" href="#random"><tt><b>Size.random</b>()</tt></a>
982</div>
983<div class="member-description hidden">
984<div class="member-text">
985 <p>Returns a size object with random <a href="../classes/Size.html#width" onclick="return toggleMember('width', true);"><tt>width</tt></a> and <a href="../classes/Size.html#height" onclick="return toggleMember('height', true);"><tt>height</tt></a>
986values between <tt>0</tt> and <tt>1</tt>.</p>
987
988
989 <ul><b>Returns:</b>
990
991 <li>
992<tt><a href="../classes/Size.html"><tt>Size</tt></a></tt>&nbsp;&mdash;&nbsp;the newly created size object
993</li>
994
995 </ul>
996
997
998 <p>
999<b>Example</b>
1000</p>
1001
1002
1003<pre class="code">var maxSize = new Size(100, 100);
1004var randomSize = Size.random();
1005var size = maxSize * randomSize;</pre>
1006
1007</div>
1008</div>
1009</div>
1010
1011 </div>
1012
1013
1014
1015<!-- =========================== copyright notice ========================= -->
1016<p class="footer">Copyright &#169; 2011 <a href="http://www.lehni.org" target="_blank">J&uuml;rg Lehni</a> &amp; <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
1017<div class="content-end"></div>
1018
1019</body>
Note: See TracBrowser for help on using the repository browser.