@@ -408,6 +408,22 @@ var DynamicLightRecorder = DynamicLightRecorder || (function() {
408
408
var controlInfo = this . getControlInfoObject ( token ) . onDelete ( ) ;
409
409
} ,
410
410
411
+ handlePathChange : function ( path , previous ) {
412
+ if ( previous . controlledby && previous . layer === 'walls' ) {
413
+ var graphic = getObj ( 'graphic' , previous . controlledby ) ;
414
+ if ( graphic && graphic . get ( 'name' ) === 'DynamicLightRecorder' ) {
415
+ path . set ( 'top' , previous . top ) ;
416
+ path . set ( 'left' , previous . left ) ;
417
+ path . set ( 'width' , previous . width ) ;
418
+ path . set ( 'height' , previous . height ) ;
419
+ path . set ( 'scaleX' , previous . scaleX ) ;
420
+ path . set ( 'scaleY' , previous . scaleY ) ;
421
+ path . set ( 'rotation' , previous . rotation ) ;
422
+ path . set ( 'controlledby' , previous . controlledby ) ;
423
+ }
424
+ }
425
+ } ,
426
+
411
427
412
428
413
429
///////////////////////////////////////////////
@@ -1661,6 +1677,7 @@ var DynamicLightRecorder = DynamicLightRecorder || (function() {
1661
1677
registerEventHandlers = function ( ) {
1662
1678
on ( 'chat:message' , module . handleInput . bind ( module ) ) ;
1663
1679
on ( 'change:token' , module . handleTokenChange . bind ( module ) ) ;
1680
+ on ( 'change:path' , module . handlePathChange . bind ( module ) ) ;
1664
1681
on ( 'add:token' , module . handleNewToken . bind ( module ) ) ;
1665
1682
on ( 'destroy:token' , module . handleDeleteToken . bind ( module ) ) ;
1666
1683
} ;
0 commit comments