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

Unified Diff: ui/file_manager/gallery/js/image_editor/viewport.js

Issue 382143004: Remove repaint callbacks from Viewport. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « ui/file_manager/gallery/js/image_editor/image_view.js ('k') | ui/file_manager/gallery/js/slide_mode.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/gallery/js/image_editor/viewport.js
diff --git a/ui/file_manager/gallery/js/image_editor/viewport.js b/ui/file_manager/gallery/js/image_editor/viewport.js
index 1c41bdc082ee4e94399ff0906bd01efa56571f5f..df53d7476c4b98db1aa87ea62e9dbaea90dfd9cf 100644
--- a/ui/file_manager/gallery/js/image_editor/viewport.js
+++ b/ui/file_manager/gallery/js/image_editor/viewport.js
@@ -35,7 +35,6 @@ function Viewport() {
this.generation_ = 0;
- this.repaintCallbacks_ = [];
this.update();
}
@@ -155,41 +154,6 @@ Viewport.prototype.setOffset = function(x, y, ignoreClipping) {
};
/**
- * Return a closure that can be called to pan the image.
- * Useful for implementing non-trivial variants of panning (overview etc).
- * @param {number} originalX The x coordinate on the screen canvas that
- * corresponds to zero change to offsetX.
- * @param {number} originalY The y coordinate on the screen canvas that
- * corresponds to zero change to offsetY.
- * @param {function():number} scaleFunc returns the image to screen scale.
- * @param {function(number,number):boolean} hitFunc returns true if (x,y) is
- * in the valid region.
- * @return {function} The closure to pan the image.
- */
-Viewport.prototype.createOffsetSetter = function(
- originalX, originalY, scaleFunc, hitFunc) {
- var originalOffsetX = this.offsetX_;
- var originalOffsetY = this.offsetY_;
- if (!hitFunc) hitFunc = function() { return true; };
- if (!scaleFunc) scaleFunc = this.getScale.bind(this);
-
- var self = this;
- return function(x, y) {
- if (hitFunc(x, y)) {
- var scale = scaleFunc();
- self.setOffset(
- originalOffsetX + (x - originalX) / scale,
- originalOffsetY + (y - originalY) / scale);
- self.repaint();
- }
- };
-};
-
-/*
- * Access to the current viewport state.
- */
-
-/**
* @return {Rect} The image bounds in image coordinates.
*/
Viewport.prototype.getImageBounds = function() { return this.imageBounds_; };
@@ -220,7 +184,7 @@ Viewport.prototype.getScreenClipped = function() {
Viewport.prototype.getCacheGeneration = function() { return this.generation_; };
/**
- * Called on event view port state change (even if repaint has not been called).
+ * Called on event view port state change.
*/
Viewport.prototype.invalidateCaches = function() { this.generation_++; };
@@ -231,10 +195,6 @@ Viewport.prototype.getImageBoundsOnScreen = function() {
return this.imageOnScreen_;
};
-/*
- * Conversion between the screen and image coordinate spaces.
- */
-
/**
* @param {number} size Size in screen coordinates.
* @return {number} Size in image coordinates.
@@ -424,22 +384,6 @@ Viewport.prototype.update = function() {
};
/**
- * @param {function} callback Repaint callback.
- */
-Viewport.prototype.addRepaintCallback = function(callback) {
- this.repaintCallbacks_.push(callback);
-};
-
-/**
- * Repaint all clients.
- */
-Viewport.prototype.repaint = function() {
- this.update();
- for (var i = 0; i != this.repaintCallbacks_.length; i++)
- this.repaintCallbacks_[i]();
-};
-
-/**
* Obtains CSS transformation for the screen image.
* @return {string} Transformation description.
*/
« no previous file with comments | « ui/file_manager/gallery/js/image_editor/image_view.js ('k') | ui/file_manager/gallery/js/slide_mode.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698