Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(670)

Unified Diff: ui/file_manager/gallery/js/image_editor/image_util.js

Issue 398263002: Gallery: Random fixes for the Viewport class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/file_manager/gallery/js/image_editor/image_util.js
diff --git a/ui/file_manager/gallery/js/image_editor/image_util.js b/ui/file_manager/gallery/js/image_editor/image_util.js
index 7a7a2bfb85a36563af2c992124dc25a5a4ffff8c..b14454eec7db30252d26f1d173d60dd0c85135bd 100644
--- a/ui/file_manager/gallery/js/image_editor/image_util.js
+++ b/ui/file_manager/gallery/js/image_editor/image_util.js
@@ -139,6 +139,28 @@ function Rect() {
Array.apply(null, arguments));
}
+Rect.prototype = {
+ /**
+ * Obtains the x coordinate of right edge. The most right pixels in the
+ * rectangle are (x = right - 1) and the pixels (x = right) are not included
+ * in the rectangle.
+ * @return {number}
+ */
+ get right() {
+ return this.left + this.width;
+ },
+
+ /**
+ * Obtains the y coordinate of bottom edge. The most bottom pixels in the
+ * rectanlge are (y = buttom - 1) and the pixels (y = bottom) are not included
+ * in the rectangle.
+ * @return {number}
+ */
+ get bottom() {
+ return this.top + this.height;
+ }
+};
+
/**
* @param {number} factor Factor to scale.
* @return {Rect} A rectangle with every dimension scaled.
« no previous file with comments | « ui/file_manager/gallery/js/image_editor/image_transform.js ('k') | ui/file_manager/gallery/js/image_editor/image_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698