Commit 72862bd906133a2d776990ef2e5ae66a265b740e

Authored by unknown
1 parent ffcfd743

Commit changes for issue ref:#8777 :

DA > Layer change is not apply on the view.
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -2534,7 +2534,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2534 2534  
2535 2535  
2536 2536 if ($scope.isTransparencyActivated) {
2537   -
  2537 + debugger;
2538 2538 //crete temp canavs to store the original data which will be used to chnange the transparency
2539 2539 if (document.getElementById('tempCanvas') != null) {
2540 2540 $('#tempCanvas').remove();
... ... @@ -2559,46 +2559,67 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2559 2559  
2560 2560  
2561 2561 var tCanvas = document.getElementById('transparencyCanvas');
2562   - var tCanvasContext = tCanvas.getContext('2d');
  2562 + if (tCanvas != null) {
  2563 + var tCanvasContext = tCanvas.getContext('2d');
2563 2564  
2564   - var tCanvasHeight = parseInt((tCanvas.style.height).replace('px', ''));
  2565 + var tCanvasHeight = parseInt((tCanvas.style.height).replace('px', ''));
2565 2566  
2566   - var tCanvasWidth = parseInt((tCanvas.style.width).replace('px', ''));
  2567 + var tCanvasWidth = parseInt((tCanvas.style.width).replace('px', ''));
2567 2568  
2568 2569  
2569   - // var tCanvas = document.getElementById('transparencyCanvas');
2570   - if (tCanvas != null) {
2571   - clearTransCanvas();
2572   - }
2573   - var TransparencyBoxStartX = parseInt((tCanvas.style.left).replace('px', ''));
2574   - var TransparencyEndX = parseInt((tCanvas.style.left).replace('px', '')) + parseInt((tCanvas.style.width.replace('px', '')));
2575   - var TransparencyBoxStartY = parseInt((tCanvas.style.top).replace('px', ''));
2576   - var TransparencyBoxEndY = parseInt((tCanvas.style.top).replace('px', '')) + parseInt((tCanvas.style.height).replace('px', ''));
2577   - var transparencyBoxBottom = parseInt(TransparencyBoxStartY) + parseInt(tCanvasHeight);
2578   - var transparencyBoxRight = parseInt(TransparencyBoxStartX) + parseInt(tCanvasWidth);
  2570 + // var tCanvas = document.getElementById('transparencyCanvas');
  2571 + if (tCanvas != null) {
  2572 + clearTransCanvas();
  2573 + }
  2574 + var TransparencyBoxStartX = parseInt((tCanvas.style.left).replace('px', ''));
  2575 + var TransparencyEndX = parseInt((tCanvas.style.left).replace('px', '')) + parseInt((tCanvas.style.width.replace('px', '')));
  2576 + var TransparencyBoxStartY = parseInt((tCanvas.style.top).replace('px', ''));
  2577 + var TransparencyBoxEndY = parseInt((tCanvas.style.top).replace('px', '')) + parseInt((tCanvas.style.height).replace('px', ''));
  2578 + var transparencyBoxBottom = parseInt(TransparencyBoxStartY) + parseInt(tCanvasHeight);
  2579 + var transparencyBoxRight = parseInt(TransparencyBoxStartX) + parseInt(tCanvasWidth);
2579 2580  
2580   - var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData;
  2581 + var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData;
2581 2582  
2582   - $.each(BodyRegionDictionary, function (index, value) {
2583   - //debugger;
2584   - // alert(' $.each(BodyRegionDictionary1')
  2583 + $.each(BodyRegionDictionary, function (index, value) {
  2584 + //debugger;
  2585 + // alert(' $.each(BodyRegionDictionary1')
2585 2586  
2586   - var bodyRegionRight = parseInt(value.X) + parseInt(value.Width);
2587   - var bodyRegionBottom = parseInt(value.Y) + parseInt(value.Height);
  2587 + var bodyRegionRight = parseInt(value.X) + parseInt(value.Width);
  2588 + var bodyRegionBottom = parseInt(value.Y) + parseInt(value.Height);
2588 2589  
2589 2590  
2590   - // alert(' $.each(BodyRegionDictionary3. bodyRegionRight: ' + bodyRegionRight + ', bodyRegionBottom: ' + bodyRegionBottom)
2591   - if (TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) {
2592   - //var transNumber = parseInt(document.getElementById("txtTransparencyChange").value);
2593   - // debugger;
2594   - $scope.layerNumber = parseInt(txtlayerNumber.value);
  2591 + // alert(' $.each(BodyRegionDictionary3. bodyRegionRight: ' + bodyRegionRight + ', bodyRegionBottom: ' + bodyRegionBottom)
  2592 + if (TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) {
  2593 + //var transNumber = parseInt(document.getElementById("txtTransparencyChange").value);
  2594 + // debugger;
  2595 + $scope.layerNumber = parseInt(txtlayerNumber.value);
2595 2596  
2596 2597  
2597   - $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, TransparencyBoxStartX, transparencyBoxRight, TransparencyBoxStartY, transparencyBoxBottom, $scope, true, false);
2598   - }
  2598 + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, TransparencyBoxStartX, transparencyBoxRight, TransparencyBoxStartY, transparencyBoxBottom, $scope, true, false);
  2599 + }
2599 2600  
2600 2601  
2601   - })
  2602 + })
  2603 + }else
  2604 + {
  2605 + //#8777 :DA > Layer change is not apply on the view.
  2606 + var tranparencyLayer;
  2607 +
  2608 + var currentLayer = parseInt($('#txtlayerNumber').val());
  2609 + if (currentLayer == $rootScope.totalLayers) {
  2610 + tranparencyLayer = currentLayer;
  2611 + }
  2612 + else if (currentLayer==0)
  2613 + {
  2614 + tranparencyLayer = 0;
  2615 + }
  2616 + else {
  2617 + tranparencyLayer = currentLayer + 1;
  2618 + }
  2619 + $scope.layerNumber = tranparencyLayer;
  2620 + $('#txtlayerNumber').val($scope.layerNumber);
  2621 + $scope.CalculateImageCordinates($rootScope.viewOrientationId);
  2622 + }
2602 2623 }
2603 2624  
2604 2625 else {
... ...