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

Unified Diff: ui/file_manager/gallery/js/slide_mode.js

Issue 398263002: Gallery: Random fixes for the Viewport class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. 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/viewport.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/gallery/js/slide_mode.js
diff --git a/ui/file_manager/gallery/js/slide_mode.js b/ui/file_manager/gallery/js/slide_mode.js
index 6dec25a0eed57b1d584a86a8c225256423e9da53..2d48a8940a78ea894dcc7996c6c5d7541c81e9da 100644
--- a/ui/file_manager/gallery/js/slide_mode.js
+++ b/ui/file_manager/gallery/js/slide_mode.js
@@ -394,7 +394,7 @@ SlideMode.prototype.getSelectedImageRect = function() {
if (this.getSelectedIndex() < 0)
return null;
else
- return this.viewport_.getScreenClipped();
+ return this.viewport_.getImageBoundsOnScreen();
};
/**
@@ -889,8 +889,8 @@ SlideMode.prototype.onKeyDown = function(event) {
* @private
*/
SlideMode.prototype.onResize_ = function() {
- this.viewport_.sizeByFrameAndFit(this.container_);
- this.viewport_.update();
+ this.viewport_.setScreenSize(
+ this.container_.clientWidth, this.container_.clientHeight);
this.editor_.getBuffer().draw();
};
@@ -1047,7 +1047,7 @@ SlideMode.prototype.isSlideshowOn_ = function() {
SlideMode.prototype.startSlideshow = function(opt_interval, opt_event) {
// Reset zoom.
this.viewport_.setZoomIndex(0);
- this.imageView_.draw();
+ this.imageView_.applyViewportChange();
// Set the attribute early to prevent the toolbar from flashing when
// the slideshow is being started from the mosaic view.
@@ -1202,7 +1202,7 @@ SlideMode.prototype.toggleEditor = function(opt_event) {
if (this.isEditing()) { // isEditing has just been flipped to a new value.
// Reset zoom.
this.viewport_.setZoomIndex(0);
- this.imageView_.draw();
+ this.imageView_.applyViewportChange();
if (this.context_.readonlyDirName) {
this.editor_.getPrompt().showAt(
'top', 'GALLERY_READONLY_WARNING', 0, this.context_.readonlyDirName);
« no previous file with comments | « ui/file_manager/gallery/js/image_editor/viewport.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698