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

Unified Diff: chrome/browser/resources/print_preview/data/coordinate2d.js

Issue 10108001: Refactor print preview web ui (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove new widget Created 8 years, 8 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: chrome/browser/resources/print_preview/data/coordinate2d.js
diff --git a/chrome/browser/resources/print_preview/data/coordinate2d.js b/chrome/browser/resources/print_preview/data/coordinate2d.js
new file mode 100644
index 0000000000000000000000000000000000000000..df7789c33a71903233f76c2828a81891d7363c44
--- /dev/null
+++ b/chrome/browser/resources/print_preview/data/coordinate2d.js
@@ -0,0 +1,41 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+cr.define('print_preview', function() {
+ 'use strict';
+
+ function Coordinate2d(x, y) {
dpapad1 2012/04/19 22:45:01 Document this class.
Robert Toscano 2012/04/23 23:00:09 Done.
+ this.x_ = x;
+ this.y_ = y;
+ };
+
+ Coordinate2d.prototype = {
+ get x() {
+ return this.x_;
+ },
+
+ get y() {
+ return this.y_;
+ },
+
+ translate: function(x, y) {
+ return new Coordinate2d(this.x_ + x, this.y_ + y);
+ },
+
+ scale: function(factor) {
+ return new Coordinate2d(this.x_ * factor, this.y_ * factor);
+ },
+
+ equals: function(other) {
+ return other != null &&
+ this.x_ == other.x_ &&
+ this.y_ == other.y_;
+ }
+ };
+
+ // Export
+ return {
+ Coordinate2d: Coordinate2d
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698