From 27b67d4fec71fdf17475fe905828f228d4058171 Mon Sep 17 00:00:00 2001 From: nikita Date: Mon, 16 Jan 2017 18:30:46 +0530 Subject: [PATCH] resolved bug. rename a function. --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 8c77396..8a01265 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -11,7 +11,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.imagePath = ""; $rootScope.BodyRegionData; $rootScope.BodyRegionCordinatesData; - $scope.isTransparencyActivated = false; + $scope.isTransparencyActivated = false; $rootScope.BodyLayerData; $rootScope.VocabTermData; @@ -37,6 +37,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //for transarency scale $scope.TBDrawStartX; $scope.TBDrawStartY; + $scope.isTBDrawnOnBodyRegion; $rootScope.path = "~/../content/images/speeachBubbleClose.png"; $rootScope.isHighLight = false; $rootScope.coloredImageCanvasList = []; @@ -3896,9 +3897,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo function mouseUpListener(e) { - // $selection.remove(); - // debugger; - + + $scope.isTBDrawnOnBodyRegion = false; //alert('mouse up'); console.log('MOUSE UP'); $(".com").remove(); @@ -3984,7 +3984,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo document.getElementById('canvasDiv').appendChild(transparencyCanvas); $scope.transparencyChangeCounter = 0; - $('#transparencyCanvas').resizable({ handles: "e,s,se,w,n,ne,nw,sw", stop: function (event, ui) { resizeCanvas(); }, start: function (event, ui) { clearTransCanvas(); } }); + $('#transparencyCanvas').resizable({ handles: "e,s,se,w,n,ne,nw,sw", stop: function (event, ui) { resizeTransparencyBox(); }, start: function (event, ui) { clearTransCanvas(); } }); $scope.transparencyCanvasHeight = transparencyCanvas.height; $scope.transparencyCanvasWidth = transparencyCanvas.width; @@ -3997,6 +3997,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } if ($scope.TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && $scope.TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) { + $scope.isTBDrawnOnBodyRegion = true; if (($rootScope.voId == "9" || $rootScope.voId == "11")) { if (value.bodyRegionId == "6") { @@ -4806,9 +4807,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo - function resizeCanvas() { - //debugger; - // alert('reload') + function resizeTransparencyBox() { + clearTransCanvas(); if ($('#speechBubbleTrns').length > 0) { $('#speechBubbleTrns').remove(); @@ -4850,6 +4850,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.isResized = true; + if ($scope.isTBDrawnOnBodyRegion == false) { + $scope.layerNumber = $scope.layerNumber + 1; + } if (tCanvasHeight != $scope.transparencyCanvasHeight || tCanvasWidth != $scope.transparencyCanvasWidth) { @@ -4868,7 +4871,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo document.getElementById('canvasDiv').appendChild(transparencyCanvas); - $('#transparencyCanvas').resizable({ handles: "e,s,se,w,n,ne,nw,sw", stop: function (event, ui) { resizeCanvas(); }, start: function (event, ui) { clearTransCanvas(); } }); + $('#transparencyCanvas').resizable({ handles: "e,s,se,w,n,ne,nw,sw", stop: function (event, ui) { resizeTransparencyBox(); }, start: function (event, ui) { clearTransCanvas(); } }); $(".ui-wrapper").css("z-index", "600"); //bind click listener @@ -4918,7 +4921,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false); - + $scope.isTBDrawnOnBodyRegion = true; } -- libgit2 0.21.4