mirror of
				https://github.com/Ylianst/MeshCentral.git
				synced 2025-03-09 15:40:18 +00:00 
			
		
		
		
	Added remote desktop zoom
This commit is contained in:
		
							parent
							
								
									9c522011f6
								
							
						
					
					
						commit
						e3e6aa25d2
					
				
					 6 changed files with 38 additions and 20 deletions
				
			
		| 
						 | 
				
			
			@ -450,11 +450,14 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
 | 
			
		|||
        if (obj.State != 3) return;
 | 
			
		||||
        if (Action != null && obj.Canvas != null) {
 | 
			
		||||
            if (!event) { var event = window.event; }
 | 
			
		||||
 | 
			
		||||
            var ScaleFactorHeight = (obj.Canvas.canvas.height / obj.CanvasId.clientHeight);
 | 
			
		||||
            var ScaleFactorWidth = (obj.Canvas.canvas.width / obj.CanvasId.clientWidth);
 | 
			
		||||
            var Offsets = obj.GetPositionOfControl(obj.Canvas.canvas);
 | 
			
		||||
            var X = ((event.pageX - Offsets[0]) * ScaleFactorWidth);
 | 
			
		||||
            var Y = ((event.pageY - Offsets[1]) * ScaleFactorHeight);
 | 
			
		||||
            if (event.addx) { X += event.addx; }
 | 
			
		||||
            if (event.addy) { Y += event.addy; }
 | 
			
		||||
 | 
			
		||||
            if (X >= 0 && X <= obj.Canvas.canvas.width && Y >= 0 && Y <= obj.Canvas.canvas.height) {
 | 
			
		||||
                var Button = 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -779,9 +779,13 @@ var CreateAmtRemoteDesktop = function (divid, scrolldiv) {
 | 
			
		|||
    obj.mouseup = function (e) { obj.buttonmask &= (0xFFFF - (1 << e.button)); return obj.mousemove(e); }
 | 
			
		||||
    obj.mousemove = function (e) {
 | 
			
		||||
        if (obj.state != 4) return true;
 | 
			
		||||
        var pos = obj.getPositionOfControl(Q(obj.canvasid));
 | 
			
		||||
        obj.mx = (e.pageX - pos[0]) * (obj.canvas.canvas.height / Q(obj.canvasid).offsetHeight);
 | 
			
		||||
        obj.my = ((e.pageY - pos[1] + (scrolldiv ? scrolldiv.scrollTop : 0)) * (obj.canvas.canvas.width / Q(obj.canvasid).offsetWidth));
 | 
			
		||||
        var ScaleFactorHeight = (obj.canvas.canvas.height / Q(obj.canvasid).offsetHeight);
 | 
			
		||||
        var ScaleFactorWidth = (obj.canvas.canvas.width / Q(obj.canvasid).offsetWidth);
 | 
			
		||||
        var Offsets = obj.getPositionOfControl(Q(obj.canvasid));
 | 
			
		||||
        obj.mx = ((event.pageX - Offsets[0]) * ScaleFactorWidth);
 | 
			
		||||
        obj.my = ((event.pageY - Offsets[1]) * ScaleFactorHeight);
 | 
			
		||||
        if (event.addx) { obj.mx += event.addx; }
 | 
			
		||||
        if (event.addy) { obj.my += event.addy; }
 | 
			
		||||
 | 
			
		||||
        // ###BEGIN###{DesktopRotation}
 | 
			
		||||
        if (obj.noMouseRotate != true) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue