diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 8d2af9f..5e57a1e 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -5565,19 +5565,35 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.horizontlScrollPosition = canvasDiv.scrollLeft; var currentMousePosition = $scope.getMousePos(e.pageX,e.pageY,windowviewid); - var move_x = currentMousePosition.x + $scope.horizontlScrollPosition, - move_y = currentMousePosition.y + $scope.verticalScrollPosition, - - width = move_x - $scope.TransparencyBoxStartX, - height = move_y - $scope.TransparencyBoxStartY, - new_x, new_y; + var move_x = currentMousePosition.x + $scope.horizontlScrollPosition; + var move_y = currentMousePosition.y + $scope.verticalScrollPosition; + var width = 0; + var height = 0; + if(move_x < $scope.TransparencyBoxStartX){ + width = $scope.TransparencyBoxStartX - move_x; + } + else{ + width = move_x - $scope.TransparencyBoxStartX; + } + if (move_y < $scope.TransparencyBoxStartY) { + height = $scope.TransparencyBoxStartY - move_y; + } + else{ + height = move_y - $scope.TransparencyBoxStartY; + } - new_x = (move_x < $scope.TransparencyBoxStartX) ? ($scope.TransparencyBoxStartX - width) : $scope.TransparencyBoxStartX; - new_y = (move_y < $scope.TransparencyBoxStartY) ? ($scope.TransparencyBoxStartY - height) : $scope.TransparencyBoxStartY; + var new_x, new_y; + new_x = (move_x < $scope.TransparencyBoxStartX) ? move_x : $scope.TransparencyBoxStartX; + new_y = (move_y < $scope.TransparencyBoxStartY) ?move_y : $scope.TransparencyBoxStartY; + $('.rectangle').css({ + 'position': 'absolute', + 'left': new_x, + 'top':new_y, 'width': width, 'height': height, + //'background': 'transparent' }); @@ -5605,7 +5621,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid,'currentLayerNumber',parseInt($('#txtLayerNumberDA_' + windowviewid).val())); - $('.rectangle').remove(); + // $('.rectangle').remove(); var currentMousePosition = $scope.getMousePos(e.pageX,e.pageY,windowviewid); @@ -5674,6 +5690,26 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var transparencyBoxRight = tBoxDimesions.transparencyBoxRight; var bodyRegionRight = tBoxDimesions.bodyRegionRight; var bodyRegionBottom = tBoxDimesions.bodyRegionBottom; + var width = 0; + var height = 0; + if (TransparencyEndX < $scope.TransparencyBoxStartX) { + width = $scope.TransparencyBoxStartX - TransparencyEndX; + } + else { + width = TransparencyEndX - $scope.TransparencyBoxStartX; + } + if (TransparencyBoxEndY < $scope.TransparencyBoxStartY) { + height = $scope.TransparencyBoxStartY - TransparencyBoxEndY; + } + else { + height = TransparencyBoxEndY - $scope.TransparencyBoxStartY; + } + + var new_x, new_y; + + new_x = (TransparencyEndX < $scope.TransparencyBoxStartX) ? TransparencyEndX : $scope.TransparencyBoxStartX; + new_y = (TransparencyBoxEndY < $scope.TransparencyBoxStartY) ? TransparencyBoxEndY : $scope.TransparencyBoxStartY; + var transparencyCanvas = document.createElement('canvas'); var tBox = document.getElementById('transparencyCanvas_'+ windowviewid); @@ -5681,11 +5717,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l transparencyCanvas.id = 'transparencyCanvas_'+ windowviewid; $scope.transparencyCanvasId = transparencyCanvas.id; - transparencyCanvas.height = TransparencyBoxEndY - $scope.startY; - transparencyCanvas.width = TransparencyEndX - $scope.startX; + transparencyCanvas.height = height; + transparencyCanvas.width = width; transparencyCanvas.style.position = "absolute"; - transparencyCanvas.style.left = $scope.startX + 'px' // x + "px"; - transparencyCanvas.style.top = $scope.startY + "px"//y + "px"; + //transparencyCanvas.style.left = $scope.startX + 'px' // x + "px"; + //transparencyCanvas.style.top = $scope.startY + "px"//y + "px"; + transparencyCanvas.style.left = new_x + 'px' // x + "px"; + transparencyCanvas.style.top = new_y + "px" transparencyCanvas.style.border = "black 1px solid"; transparencyCanvas.style.backgroundColor = "transparent"; transparencyCanvas.style.zIndex = 200;