@@ -1239,20 +1239,23 @@ Leap.ToolList.prototype.append = function(other){
1239
1239
for ( i = 0 ; i < other . length ; i ++ ) this . push ( new Leap . Tool ( other [ i ] ) ) ;
1240
1240
} ;
1241
1241
1242
- Leap . Screen = function ( data ) {
1242
+ Leap . Screen = function ( data , width , height ) {
1243
1243
1244
1244
this . _data = data ;
1245
1245
1246
1246
if ( data ) {
1247
-
1247
+
1248
+ if ( ! ( "3" in data ) ) this . _data [ 3 ] = window . innerWidth ;
1249
+ if ( ! ( "4" in data ) ) this . _data [ 4 ] = window . innerHeight ;
1250
+
1248
1251
this . _plane = new Leap . Plane ( data [ 0 ] , data [ 1 ] , data [ 2 ] ) ;
1249
1252
this . _center = data [ 0 ] . plus ( data [ 2 ] ) . dividedBy ( 2 ) ;
1250
1253
this . _origin = data [ 1 ] . plus ( data [ 1 ] . minus ( this . _center ) ) ;
1251
1254
1252
1255
var xv = data [ 2 ] . minus ( data [ 0 ] ) ;
1253
1256
var yv = data [ 0 ] . minus ( data [ 1 ] ) ;
1254
- var xscale = 2 * xv . magnitude ( ) / window . innerWidth ;
1255
- var yscale = 4 * yv . magnitude ( ) / window . innerHeight ;
1257
+ var xscale = 2 * xv . magnitude ( ) / this . _data [ 3 ] ;
1258
+ var yscale = 4 * yv . magnitude ( ) / this . _data [ 4 ] ;
1256
1259
this . _xspan = xv . normalized ( ) . dividedBy ( xscale ) ;
1257
1260
this . _yspan = yv . normalized ( ) . dividedBy ( yscale ) ;
1258
1261
@@ -1330,7 +1333,7 @@ Leap.ScreenList = function(){
1330
1333
var screens = JSON . parse ( localStorage . screens ) ;
1331
1334
for ( var id in screens ) {
1332
1335
var screen = screens [ id ] ;
1333
- var data = [ new Leap . Vector ( screen [ 0 ] ) , new Leap . Vector ( screen [ 1 ] ) , new Leap . Vector ( screen [ 2 ] ) ] ;
1336
+ var data = [ new Leap . Vector ( screen [ 0 ] ) , new Leap . Vector ( screen [ 1 ] ) , new Leap . Vector ( screen [ 2 ] ) , screen [ 3 ] , screen [ 4 ] ] ;
1334
1337
this . push ( new Leap . Screen ( data ) ) ;
1335
1338
}
1336
1339
}
0 commit comments