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 * The overlay displaying the image. | 8 * The overlay displaying the image. |
9 * | 9 * |
10 * @param {HTMLElement} container The container element. | 10 * @param {HTMLElement} container The container element. |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 this.paintDeviceRect(this.contentCanvas_, new Rect(this.contentCanvas_)); | 122 this.paintDeviceRect(this.contentCanvas_, new Rect(this.contentCanvas_)); |
123 ImageUtil.trace.reportTimer('paint'); | 123 ImageUtil.trace.reportTimer('paint'); |
124 } | 124 } |
125 }; | 125 }; |
126 | 126 |
127 /** | 127 /** |
128 * Applies the viewport change that does not affect the screen cache size (zoom | 128 * Applies the viewport change that does not affect the screen cache size (zoom |
129 * change or offset change) with animation. | 129 * change or offset change) with animation. |
130 */ | 130 */ |
131 ImageView.prototype.applyViewportChange = function() { | 131 ImageView.prototype.applyViewportChange = function() { |
132 this.setTransform( | 132 if (this.screenImage_) { |
133 this.screenImage_, | 133 this.setTransform( |
134 new ImageView.Effect.None(), | 134 this.screenImage_, |
135 ImageView.Effect.DEFAULT_DURATION); | 135 new ImageView.Effect.None(), |
| 136 ImageView.Effect.DEFAULT_DURATION); |
| 137 } |
136 }; | 138 }; |
137 | 139 |
138 /** | 140 /** |
139 * @return {number} The cache generation. | 141 * @return {number} The cache generation. |
140 */ | 142 */ |
141 ImageView.prototype.getCacheGeneration = function() { | 143 ImageView.prototype.getCacheGeneration = function() { |
142 return this.contentGeneration_; | 144 return this.contentGeneration_; |
143 }; | 145 }; |
144 | 146 |
145 /** | 147 /** |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 }; | 970 }; |
969 | 971 |
970 ImageView.Effect.Rotate.prototype = { __proto__: ImageView.Effect.prototype }; | 972 ImageView.Effect.Rotate.prototype = { __proto__: ImageView.Effect.prototype }; |
971 | 973 |
972 /** | 974 /** |
973 * @override | 975 * @override |
974 */ | 976 */ |
975 ImageView.Effect.Rotate.prototype.transform = function(element, viewport) { | 977 ImageView.Effect.Rotate.prototype.transform = function(element, viewport) { |
976 return viewport.getInverseTransformForRotatedImage(this.orientation_); | 978 return viewport.getInverseTransformForRotatedImage(this.orientation_); |
977 }; | 979 }; |
OLD | NEW |