Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 4d9b66df066998b4f1a72cb4fc8f9d4f464ee593 Mon Sep 17 00:00:00 2001
- From: Appsotutely <opensource@appsotutely.com>
- Date: Fri, 8 Jul 2011 00:12:53 -0400
- Subject: [PATCH] Fix for screenshots scene to rotate properly on TouchPad
- ---
- app/assistants/screenshots-assistant.js | 18 +++++++++++++++---
- 1 files changed, 15 insertions(+), 3 deletions(-)
- diff --git a/app/assistants/screenshots-assistant.js b/app/assistants/screenshots-assistant.js
- index 22f88fd..6f0cf39 100644
- --- a/app/assistants/screenshots-assistant.js
- +++ b/app/assistants/screenshots-assistant.js
- @@ -8,6 +8,7 @@ ScreenshotsAssistant.prototype.setup = function()
- {
- try
- {
- + this.controller.window.onresize = this.handleOrientation.bind(this);
- // setup back tap
- this.backElement = this.controller.get('back');
- this.backTapHandler = this.backTap.bindAsEventListener(this);
- @@ -93,13 +94,13 @@ ScreenshotsAssistant.prototype.getSizeInfo = function(ss) {
- img.src = ss;
- img.onload = function() {
- var ssRatio = img.height / img.width,
- - windowRatio = Mojo.Environment.DeviceInfo.screenHeight / Mojo.Environment.DeviceInfo.screenWidth,
- + windowRatio = this.controller.window.innerHeight / this.controller.window.innerWidth,
- scaleWidth, scaleHeight;
- if (ssRatio < windowRatio) {
- - scaleWidth = Mojo.Environment.DeviceInfo.screenWidth;
- + scaleWidth = this.controller.window.innerWidth;
- scaleHeight = parseInt((scaleWidth * ssRatio), 10);
- } else {
- - scaleHeight = Mojo.Environment.DeviceInfo.screenHeight;
- + scaleHeight = this.controller.window.innerHeight;
- scaleWidth = parseInt((scaleHeight / ssRatio), 10);
- }
- this.controller.get('screenshotView').mojo.manualSize(scaleWidth,scaleHeight);
- @@ -124,6 +125,14 @@ ScreenshotsAssistant.prototype.orientationChanged = function(orientation)
- };
- */
- +ScreenshotsAssistant.prototype.handleOrientation = function(){
- + this.controller.get('ss-scene').style.height = this.controller.window.innerHeight + "px";
- + this.controller.get('ss-scene').style.width = this.controller.window.innerWidth + "px";
- + this.controller.get('screenshotView').style.height = this.controller.window.innerHeight + "px";
- + this.controller.get('screenshotView').style.width = this.controller.window.innerWidth + "px";
- + this.getSizeInfo(this.screenshots[this.current]);
- +};
- +
- ScreenshotsAssistant.prototype.activate = function(event)
- {
- try
- @@ -134,9 +143,12 @@ ScreenshotsAssistant.prototype.activate = function(event)
- }
- */
- + /*
- this.controller.get('ss-scene').style.width = Mojo.Environment.DeviceInfo.screenWidth + 'px';
- this.controller.get('ss-scene').style.height = Mojo.Environment.DeviceInfo.screenHeight + 'px';
- this.getSizeInfo(this.screenshots[this.current]);
- + */
- + this.handleOrientation();
- if (this.controller.window.PalmSystem)
- {
- --
- 1.7.4.msysgit.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement