Commit 91a26525878c1149591669a518a2663cd2259f31

Authored by Nikita Kulshreshtha
1 parent 5fbc9df7

mirror image canvas was code was written irrespective of bodyviews.

checked bodyviewid
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -2937,34 +2937,36 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l @@ -2937,34 +2937,36 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
2937 var grayCanvasMRY; 2937 var grayCanvasMRY;
2938 2938
2939 //draw a canvas for same bodyregion wich will be flipped after coloring the body system 2939 //draw a canvas for same bodyregion wich will be flipped after coloring the body system
2940 - if (TermExistInBodyRegionId == 4 || TermExistInBodyRegionId == 5 || TermExistInBodyRegionId == 6) { 2940 + if ($rootScope.voId == "1" || $rootScope.voId == "4" || $rootScope.voId == "5" || $rootScope.voId == "8") {
  2941 + if (TermExistInBodyRegionId == 4 || TermExistInBodyRegionId == 5 || TermExistInBodyRegionId == 6) {
2941 2942
2942 2943
2943 - var grayCanvasMRID = 'imageCanvas' + TermExistInBodyRegionId + '_MR';  
2944 - var grayCanvasMR = document.getElementById(grayCanvasMRID);  
2945 - grayCanvasMRX = grayCanvasMR.style.left;  
2946 - grayCanvasMRY = grayCanvasMR.style.top; 2944 + var grayCanvasMRID = 'imageCanvas' + TermExistInBodyRegionId + '_MR';
  2945 + var grayCanvasMR = document.getElementById(grayCanvasMRID);
  2946 + grayCanvasMRX = grayCanvasMR.style.left;
  2947 + grayCanvasMRY = grayCanvasMR.style.top;
2947 2948
2948 - var FlipedImgCanvas = document.createElement('canvas');  
2949 - FlipedImgCanvas.height = canvasHeight;  
2950 - FlipedImgCanvas.width = canvasWidth;  
2951 - FlipedImgCanvas.setAttribute("data-IsMirrored", "Y")  
2952 - FlipedImgCanvas.style.position = "absolute";  
2953 - FlipedImgCanvas.style.left = canvasX + "px";  
2954 - FlipedImgCanvas.style.top = canvasY + "px";  
2955 - FlipedImgCanvas.style.visibility = 'hidden';  
2956 - FlipedImgCanvas.id = 'imageCanvas' + TermExistInBodyRegionId + '_MR'; 2949 + var FlipedImgCanvas = document.createElement('canvas');
  2950 + FlipedImgCanvas.height = canvasHeight;
  2951 + FlipedImgCanvas.width = canvasWidth;
  2952 + FlipedImgCanvas.setAttribute("data-IsMirrored", "Y")
  2953 + FlipedImgCanvas.style.position = "absolute";
  2954 + FlipedImgCanvas.style.left = canvasX + "px";
  2955 + FlipedImgCanvas.style.top = canvasY + "px";
  2956 + FlipedImgCanvas.style.visibility = 'hidden';
  2957 + FlipedImgCanvas.id = 'imageCanvas' + TermExistInBodyRegionId + '_MR';
2957 2958
2958 - //remove previous canavs  
2959 - $('#' + grayCanvasMRID).remove(); 2959 + //remove previous canavs
  2960 + $('#' + grayCanvasMRID).remove();
2960 2961
2961 - //add new canvas on same location and after flipping it will be added to mirrored position  
2962 - document.getElementById('canvasDiv').appendChild(FlipedImgCanvas);  
2963 - //put grayData 2962 + //add new canvas on same location and after flipping it will be added to mirrored position
  2963 + document.getElementById('canvasDiv').appendChild(FlipedImgCanvas);
  2964 + //put grayData
2964 2965
2965 - var filppedCanvasContx = FlipedImgCanvas.getContext("2d");  
2966 - filppedCanvasContx.putImageData(gData, 0, 0); 2966 + var filppedCanvasContx = FlipedImgCanvas.getContext("2d");
  2967 + filppedCanvasContx.putImageData(gData, 0, 0);
2967 2968
  2969 + }
2968 } 2970 }
2969 2971
2970 grayImageDataVar = null; 2972 grayImageDataVar = null;