OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 'use strict'; | |
6 | |
7 /** | 5 /** |
8 * Crop mode. | 6 * Crop mode. |
9 * | 7 * |
10 * @extends {ImageEditor.Mode} | 8 * @extends {ImageEditor.Mode} |
11 * @constructor | 9 * @constructor |
12 */ | 10 */ |
13 ImageEditor.Mode.Crop = function() { | 11 ImageEditor.Mode.Crop = function() { |
14 ImageEditor.Mode.call(this, 'crop', 'GALLERY_CROP'); | 12 ImageEditor.Mode.call(this, 'crop', 'GALLERY_CROP'); |
15 }; | 13 }; |
16 | 14 |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 break; | 661 break; |
664 case 'bottom': | 662 case 'bottom': |
665 this.bounds_.bottom = this.bounds_.top + newHeight; | 663 this.bounds_.bottom = this.bounds_.top + newHeight; |
666 break; | 664 break; |
667 case 'none': | 665 case 'none': |
668 this.bounds_.top = middle - newHeight / 2; | 666 this.bounds_.top = middle - newHeight / 2; |
669 this.bounds_.bottom = middle + newHeight / 2; | 667 this.bounds_.bottom = middle + newHeight / 2; |
670 break; | 668 break; |
671 } | 669 } |
672 }; | 670 }; |
OLD | NEW |