Index: trunk/parsers/wikidom/lib/synth/es.Position.js |
— | — | @@ -59,6 +59,30 @@ |
60 | 60 | /* Methods */ |
61 | 61 | |
62 | 62 | /** |
| 63 | + * Adds the values of a given position to this one. |
| 64 | + * |
| 65 | + * @method |
| 66 | + * @param position {es.Position} Position to add values from |
| 67 | + */ |
| 68 | +es.Position.prototype.add = function( position ) { |
| 69 | + this.top += position.top; |
| 70 | + this.bottom += position.bottom; |
| 71 | + this.left += position.left; |
| 72 | +}; |
| 73 | + |
| 74 | +/** |
| 75 | + * Subtracts the values of a given position to this one. |
| 76 | + * |
| 77 | + * @method |
| 78 | + * @param position {es.Position} Position to subtract values from |
| 79 | + */ |
| 80 | +es.Position.prototype.subtract = function( position ) { |
| 81 | + this.top -= position.top; |
| 82 | + this.bottom -= position.bottom; |
| 83 | + this.left -= position.left; |
| 84 | +}; |
| 85 | + |
| 86 | +/** |
63 | 87 | * Checks if this position is the same as another one. |
64 | 88 | * |
65 | 89 | * @method |