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

Side by Side 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 extra files 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 cr.define('print_preview', function() {
6 'use strict';
7
8 function Coordinate2d(x, y) {
9 this.x_ = x;
10 this.y_ = y;
11 };
12
13 Coordinate2d.prototype = {
14 get x() {
15 return this.x_;
16 },
17
18 get y() {
19 return this.y_;
20 },
21
22 translate: function(x, y) {
23 return new Coordinate2d(this.x_ + x, this.y_ + y);
24 },
25
26 scale: function(factor) {
27 return new Coordinate2d(this.x_ * factor, this.y_ * factor);
28 },
29
30 equals: function(other) {
31 return other != null &&
32 this.x_ == other.x_ &&
33 this.y_ == other.y_;
34 }
35 };
36
37 // Export
38 return {
39 Coordinate2d: Coordinate2d
40 };
41 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698