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'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * ImageEditor is the top level object that holds together and connects | 8 * ImageEditor is the top level object that holds together and connects |
9 * everything needed for image editing. | 9 * everything needed for image editing. |
10 * | 10 * |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 if (action == ImageBuffer.DoubleTapAction.COMMIT) | 608 if (action == ImageBuffer.DoubleTapAction.COMMIT) |
609 this.leaveMode(true); | 609 this.leaveMode(true); |
610 else if (action == ImageBuffer.DoubleTapAction.CANCEL) | 610 else if (action == ImageBuffer.DoubleTapAction.CANCEL) |
611 this.leaveMode(false); | 611 this.leaveMode(false); |
612 } | 612 } |
613 }; | 613 }; |
614 | 614 |
615 /** | 615 /** |
616 * Hide the tools that overlap the given rectangular frame. | 616 * Hide the tools that overlap the given rectangular frame. |
617 * | 617 * |
618 * @param {Rect} frame Hide the tool that overlaps this rect. | 618 * @param {ImageRect} frame Hide the tool that overlaps this rect. |
619 * @param {Rect} transparent But do not hide the tool that is completely inside | 619 * @param {ImageRect} transparent But do not hide the tool that is completely |
620 * this rect. | 620 * inside this rect. |
621 */ | 621 */ |
622 ImageEditor.prototype.hideOverlappingTools = function(frame, transparent) { | 622 ImageEditor.prototype.hideOverlappingTools = function(frame, transparent) { |
623 var tools = this.rootContainer_.ownerDocument.querySelectorAll('.dimmable'); | 623 var tools = this.rootContainer_.ownerDocument.querySelectorAll('.dimmable'); |
624 var changed = false; | 624 var changed = false; |
625 for (var i = 0; i != tools.length; i++) { | 625 for (var i = 0; i != tools.length; i++) { |
626 var tool = tools[i]; | 626 var tool = tools[i]; |
627 var toolRect = tool.getBoundingClientRect(); | 627 var toolRect = tool.getBoundingClientRect(); |
628 var overlapping = | 628 var overlapping = |
629 (frame && frame.intersects(toolRect)) && | 629 (frame && frame.intersects(toolRect)) && |
630 !(transparent && transparent.contains(toolRect)); | 630 !(transparent && transparent.contains(toolRect)); |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1195 | 1195 |
1196 /** | 1196 /** |
1197 * Hide the prompt. | 1197 * Hide the prompt. |
1198 */ | 1198 */ |
1199 ImageEditor.Prompt.prototype.hide = function() { | 1199 ImageEditor.Prompt.prototype.hide = function() { |
1200 if (!this.prompt_) return; | 1200 if (!this.prompt_) return; |
1201 this.prompt_.setAttribute('state', 'fadeout'); | 1201 this.prompt_.setAttribute('state', 'fadeout'); |
1202 // Allow some time for the animation to play out. | 1202 // Allow some time for the animation to play out. |
1203 this.setTimer(this.reset.bind(this), 500); | 1203 this.setTimer(this.reset.bind(this), 500); |
1204 }; | 1204 }; |
OLD | NEW |