Commit 00877e4e authored by Thomas Marrinan's avatar Thomas Marrinan

SHIFT + dblclick maximizes item at native resolution


Former-commit-id: 28fa2902af23a7239d4559ee2a65fdd1cbc59f8f
parent a82d960b
......@@ -167,8 +167,11 @@ interaction.prototype.maximizeSelectedItem = function(item, config) {
var wallRatio = config.totalWidth / config.totalHeight;
var iCenterX = config.totalWidth/2.0;
var iCenterY = config.totalHeight/2.0;
var iWidth = 0;
var iHeight = 0;
var iWidth = 1;
var iHeight = 1;
if(this.SHIFT === true){
item.aspect = item.native_width / item.native_height;
}
if (item.aspect > wallRatio) {
// Image wider than wall
iWidth = config.totalWidth - (3*config.titleBarHeight);
......@@ -182,7 +185,7 @@ interaction.prototype.maximizeSelectedItem = function(item, config) {
item.previous_left = item.left;
item.previous_top = item.top;
item.previous_width = item.width;
item.previous_height = item.height;
item.previous_height = item.width / item.aspect;
// calculate new values
item.left = iCenterX - (iWidth/2);
......
......@@ -348,7 +348,7 @@ function wsPointerDblClick(wsio, data) {
var updatedItem;
if (elem !== null) {
if (!elem.isMaximized || elem.isMaximized === 0) {
if (elem.maximized !== true) {
// need to maximize the item
updatedItem = remoteInteraction[uniqueID].maximizeSelectedItem(elem, config);
if (updatedItem !== null) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment