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

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: 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..2b1e2d6c3dd95daa611001a961b1f9bd071590ed 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,24 @@ function Rect() {
Array.apply(null, arguments));
}
+Rect.prototype = {
+ /**
+ * Obtains the x coordinate number of right edge.
mtomasz 2014/07/17 06:08:56 nit: Please add a comment, that the edge is one pi
hirono 2014/07/17 06:26:54 Done.
+ * @return {number}
+ */
+ get right() {
+ return this.left + this.width;
mtomasz 2014/07/17 05:43:20 I think it should be: this.left + this.width - 1.
hirono 2014/07/17 05:56:47 Exactly. but the right edge of the pixel is a line
mtomasz 2014/07/17 06:08:56 This is quite confusing. The left edge is within t
hirono 2014/07/17 06:26:54 Maybe this is common when implementing rectangle c
+ },
+
+ /**
+ * Obtains the y coordinate number of bottom edge.
mtomasz 2014/07/17 06:08:56 nit: coordinate number -> coordinate
hirono 2014/07/17 06:26:54 Done.
+ * @return {number}
+ */
+ get bottom() {
+ return this.top + this.height;
+ }
+};
+
/**
* @param {number} factor Factor to scale.
* @return {Rect} A rectangle with every dimension scaled.

Powered by Google App Engine
This is Rietveld 408576698