http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97955
Revision: 97955
Author: tparscal
Date: 2011-09-23 20:59:06 +0000 (Fri, 23 Sep 2011)
Log Message:
-----------
Added add and subtract functions to es.Position
Modified Paths:
--------------
trunk/parsers/wikidom/lib/synth/es.Position.js
Modified: trunk/parsers/wikidom/lib/synth/es.Position.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/es.Position.js 2011-09-23 20:42:22 UTC
(rev 97954)
+++ trunk/parsers/wikidom/lib/synth/es.Position.js 2011-09-23 20:59:06 UTC
(rev 97955)
@@ -59,6 +59,30 @@
/* Methods */
/**
+ * Adds the values of a given position to this one.
+ *
+ * @method
+ * @param position {es.Position} Position to add values from
+ */
+es.Position.prototype.add = function( position ) {
+ this.top += position.top;
+ this.bottom += position.bottom;
+ this.left += position.left;
+};
+
+/**
+ * Subtracts the values of a given position to this one.
+ *
+ * @method
+ * @param position {es.Position} Position to subtract values from
+ */
+es.Position.prototype.subtract = function( position ) {
+ this.top -= position.top;
+ this.bottom -= position.bottom;
+ this.left -= position.left;
+};
+
+/**
* Checks if this position is the same as another one.
*
* @method
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs