measure.ts 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /// <reference path="../../dist/preview release/babylon.d.ts"/>
  2. module BABYLON.GUI {
  3. export class Measure {
  4. public constructor(public left: number, public top: number, public width: number, public height: number) {
  5. }
  6. public copyFrom(other: Measure): void {
  7. this.left = other.left;
  8. this.top = other.top;
  9. this.width = other.width;
  10. this.height = other.height;
  11. }
  12. public isEqualsTo(other: Measure): boolean {
  13. if (this.left !== other.left) {
  14. return false;
  15. }
  16. if (this.top !== other.top) {
  17. return false;
  18. }
  19. if (this.width !== other.width) {
  20. return false;
  21. }
  22. if (this.height !== other.height) {
  23. return false;
  24. }
  25. return true;
  26. }
  27. public static Empty(): Measure {
  28. return new Measure(0, 0, 0, 0);
  29. }
  30. }
  31. }