Commit c25257abcd17f893a157065e950b487fef81b625

Authored by Nikita Kulshreshtha
1 parent ba4de578

now TB draw working from top right to left and left to right.

need to fix from bottom free draw
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -5565,19 +5565,35 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
5565 5565 $scope.horizontlScrollPosition = canvasDiv.scrollLeft;
5566 5566  
5567 5567 var currentMousePosition = $scope.getMousePos(e.pageX,e.pageY,windowviewid);
5568   - var move_x = currentMousePosition.x + $scope.horizontlScrollPosition,
5569   - move_y = currentMousePosition.y + $scope.verticalScrollPosition,
5570   -
5571   - width = move_x - $scope.TransparencyBoxStartX,
5572   - height = move_y - $scope.TransparencyBoxStartY,
5573   - new_x, new_y;
  5568 + var move_x = currentMousePosition.x + $scope.horizontlScrollPosition;
  5569 + var move_y = currentMousePosition.y + $scope.verticalScrollPosition;
  5570 + var width = 0;
  5571 + var height = 0;
  5572 + if(move_x < $scope.TransparencyBoxStartX){
  5573 + width = $scope.TransparencyBoxStartX - move_x;
  5574 + }
  5575 + else{
  5576 + width = move_x - $scope.TransparencyBoxStartX;
  5577 + }
  5578 + if (move_y < $scope.TransparencyBoxStartY) {
  5579 + height = $scope.TransparencyBoxStartY - move_y;
  5580 + }
  5581 + else{
  5582 + height = move_y - $scope.TransparencyBoxStartY;
  5583 + }
5574 5584  
5575   - new_x = (move_x < $scope.TransparencyBoxStartX) ? ($scope.TransparencyBoxStartX - width) : $scope.TransparencyBoxStartX;
5576   - new_y = (move_y < $scope.TransparencyBoxStartY) ? ($scope.TransparencyBoxStartY - height) : $scope.TransparencyBoxStartY;
  5585 + var new_x, new_y;
5577 5586  
  5587 + new_x = (move_x < $scope.TransparencyBoxStartX) ? move_x : $scope.TransparencyBoxStartX;
  5588 + new_y = (move_y < $scope.TransparencyBoxStartY) ?move_y : $scope.TransparencyBoxStartY;
  5589 +
5578 5590 $('.rectangle').css({
  5591 + 'position': 'absolute',
  5592 + 'left': new_x,
  5593 + 'top':new_y,
5579 5594 'width': width,
5580 5595 'height': height,
  5596 +
5581 5597 //'background': 'transparent'
5582 5598  
5583 5599 });
... ... @@ -5605,7 +5621,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5605 5621  
5606 5622 $scope.SetwindowStoreData(windowviewid,'currentLayerNumber',parseInt($('#txtLayerNumberDA_' + windowviewid).val()));
5607 5623  
5608   - $('.rectangle').remove();
  5624 + // $('.rectangle').remove();
5609 5625  
5610 5626 var currentMousePosition = $scope.getMousePos(e.pageX,e.pageY,windowviewid);
5611 5627  
... ... @@ -5674,6 +5690,26 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5674 5690 var transparencyBoxRight = tBoxDimesions.transparencyBoxRight;
5675 5691 var bodyRegionRight = tBoxDimesions.bodyRegionRight;
5676 5692 var bodyRegionBottom = tBoxDimesions.bodyRegionBottom;
  5693 + var width = 0;
  5694 + var height = 0;
  5695 + if (TransparencyEndX < $scope.TransparencyBoxStartX) {
  5696 + width = $scope.TransparencyBoxStartX - TransparencyEndX;
  5697 + }
  5698 + else {
  5699 + width = TransparencyEndX - $scope.TransparencyBoxStartX;
  5700 + }
  5701 + if (TransparencyBoxEndY < $scope.TransparencyBoxStartY) {
  5702 + height = $scope.TransparencyBoxStartY - TransparencyBoxEndY;
  5703 + }
  5704 + else {
  5705 + height = TransparencyBoxEndY - $scope.TransparencyBoxStartY;
  5706 + }
  5707 +
  5708 + var new_x, new_y;
  5709 +
  5710 + new_x = (TransparencyEndX < $scope.TransparencyBoxStartX) ? TransparencyEndX : $scope.TransparencyBoxStartX;
  5711 + new_y = (TransparencyBoxEndY < $scope.TransparencyBoxStartY) ? TransparencyBoxEndY : $scope.TransparencyBoxStartY;
  5712 +
5677 5713  
5678 5714 var transparencyCanvas = document.createElement('canvas');
5679 5715 var tBox = document.getElementById('transparencyCanvas_'+ windowviewid);
... ... @@ -5681,11 +5717,13 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5681 5717  
5682 5718 transparencyCanvas.id = 'transparencyCanvas_'+ windowviewid;
5683 5719 $scope.transparencyCanvasId = transparencyCanvas.id;
5684   - transparencyCanvas.height = TransparencyBoxEndY - $scope.startY;
5685   - transparencyCanvas.width = TransparencyEndX - $scope.startX;
  5720 + transparencyCanvas.height = height;
  5721 + transparencyCanvas.width = width;
5686 5722 transparencyCanvas.style.position = "absolute";
5687   - transparencyCanvas.style.left = $scope.startX + 'px' // x + "px";
5688   - transparencyCanvas.style.top = $scope.startY + "px"//y + "px";
  5723 + //transparencyCanvas.style.left = $scope.startX + 'px' // x + "px";
  5724 + //transparencyCanvas.style.top = $scope.startY + "px"//y + "px";
  5725 + transparencyCanvas.style.left = new_x + 'px' // x + "px";
  5726 + transparencyCanvas.style.top = new_y + "px"
5689 5727 transparencyCanvas.style.border = "black 1px solid";
5690 5728 transparencyCanvas.style.backgroundColor = "transparent";
5691 5729 transparencyCanvas.style.zIndex = 200;
... ...