Commit 06cddfd0f16578a9c42e80367bb28ee0cede2c3e

Authored by Amrita Vishnoi
1 parent e8f5d71c

Issue fixed:

The AIA was not highlighting in gray scale mode in firefox . Fixed.
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -3232,37 +3232,43 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3232 3232  
3233 3233 img.src = dataURL;
3234 3234  
3235   - var DAData = new BitmapData(img.width, img.height);
3236   - DAData.draw(img);
3237   - var RED = 0.3086; // luminance contrast value for red
3238   - var GREEN = 0.694; // luminance contrast value for green
3239   - var BLUE = 0.0820; // luminance contrast value for blue
3240 3235  
3241   - var RGB = [RED, GREEN, BLUE, 0, 0];
3242   - var RGB2 = [RED, GREEN, BLUE, 0, 0];
3243   - var RGB3 = [RED, GREEN, BLUE, 0, 0];
3244   - var ALPHA = [0, 0, 0, 1, 0];
3245 3236  
3246   - var rgbPx = RGB.concat(RGB2);
3247   - var rgbPx2 = rgbPx.concat(RGB3);
3248   - var matrix = rgbPx2.concat(ALPHA);
  3237 + img.onload = function () {
  3238 + console.log(Math.max(img.width) + ', ' + Math.max(img.height))
3249 3239  
3250   - var zeroPoint = new Point();
3251   - var grayScale = new ColorMatrixFilter(matrix);
3252   - DAData.applyFilter(DAData, DAData.rect, zeroPoint, grayScale);
  3240 + var DAData = new BitmapData(Math.max(img.width), Math.max(img.height));
  3241 + DAData.draw(img);
  3242 + var RED = 0.3086; // luminance contrast value for red
  3243 + var GREEN = 0.694; // luminance contrast value for green
  3244 + var BLUE = 0.0820; // luminance contrast value for blue
3253 3245  
3254   - context_gray.putImageData(DAData.data, 0, 0)
  3246 + var RGB = [RED, GREEN, BLUE, 0, 0];
  3247 + var RGB2 = [RED, GREEN, BLUE, 0, 0];
  3248 + var RGB3 = [RED, GREEN, BLUE, 0, 0];
  3249 + var ALPHA = [0, 0, 0, 1, 0];
3255 3250  
3256   - var grayImageData = context_gray.getImageData(0, 0, width, ht);
3257   - var grayImageImageDataVar = grayImageData.data;
  3251 + var rgbPx = RGB.concat(RGB2);
  3252 + var rgbPx2 = rgbPx.concat(RGB3);
  3253 + var matrix = rgbPx2.concat(ALPHA);
3258 3254  
3259   - if (value.haveMirror == 'true') {
3260   - $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
3261   - }
3262   - else {
3263   - //$rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId - 1)] = 1;
  3255 + var zeroPoint = new Point();
  3256 + var grayScale = new ColorMatrixFilter(matrix);
  3257 + DAData.applyFilter(DAData, DAData.rect, zeroPoint, grayScale);
  3258 +
  3259 + context_gray.putImageData(DAData.data, 0, 0)
3264 3260  
3265   - $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
  3261 + var grayImageData = context_gray.getImageData(0, 0, width, ht);
  3262 + var grayImageImageDataVar = grayImageData.data;
  3263 +
  3264 + if (value.haveMirror == 'true') {
  3265 + $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
  3266 + }
  3267 + else {
  3268 + //$rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId - 1)] = 1;
  3269 +
  3270 + $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
  3271 + }
3266 3272 }
3267 3273  
3268 3274  
... ...