Commit 9d77c288824e4233acb6edf3f29976bc67c15f19
1 parent
1fe005bd
Merge against #308 merge request.
Showing
1 changed file
with
111 additions
and
88 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -3922,6 +3922,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3922 | 3922 | $scope.TBDrawStartX = currentMousePosition.x; |
3923 | 3923 | $scope.TBDrawStartY = currentMousePosition.y; |
3924 | 3924 | |
3925 | + var canvasDiv = document.getElementById('canvasDiv'); | |
3926 | + $scope.verticalScrollPosition = canvasDiv.scrollTop; | |
3927 | + $scope.horizontlScrollPosition = canvasDiv.scrollLeft; | |
3925 | 3928 | |
3926 | 3929 | var actulalX = currentMousePosition.x + $scope.horizontlScrollPosition |
3927 | 3930 | var actualY = currentMousePosition.y + $scope.verticalScrollPosition |
... | ... | @@ -3955,6 +3958,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3955 | 3958 | |
3956 | 3959 | function mouseMoveListener(e) { |
3957 | 3960 | |
3961 | + var canvasDiv = document.getElementById('canvasDiv'); | |
3962 | + $scope.verticalScrollPosition = canvasDiv.scrollTop; | |
3963 | + $scope.horizontlScrollPosition = canvasDiv.scrollLeft; | |
3964 | + | |
3958 | 3965 | var currentMousePosition = $scope.getMousePos(e); |
3959 | 3966 | var move_x = currentMousePosition.x + $scope.horizontlScrollPosition, |
3960 | 3967 | move_y = currentMousePosition.y + $scope.verticalScrollPosition, |
... | ... | @@ -3987,6 +3994,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3987 | 3994 | $('#bord').remove(); |
3988 | 3995 | $('#sppeachBubble').remove(); |
3989 | 3996 | |
3997 | + | |
3998 | + var previewRectangleWidth = $('.rectangle').width(); | |
3999 | + var previewRectangleHeight = $('.rectangle').height() | |
4000 | + | |
4001 | + | |
3990 | 4002 | $scope.currentLayerNumber = parseInt($('#txtlayerNumber').val()); |
3991 | 4003 | $('.rectangle').remove(); |
3992 | 4004 | |
... | ... | @@ -4005,126 +4017,137 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4005 | 4017 | $scope.TransparencyEndX = TransparencyEndX; |
4006 | 4018 | $scope.TransparencyBoxEndY = TransparencyBoxEndY; |
4007 | 4019 | |
4008 | - $scope.layerNumberBeforeTBDraw = parseInt($('#txtlayerNumber').val()); | |
4020 | + if ($scope.TransparencyBoxStartX == $scope.TransparencyEndX && $scope.TransparencyBoxStartY == $scope.TransparencyBoxEndY) { | |
4021 | + // $('#transparencyScale').css('visibility', 'hidden'); | |
4022 | + } else { | |
4009 | 4023 | |
4010 | - //draw temp box to store the canvas data with original transparecy | |
4011 | - if (document.getElementById('tempCanvas') != null) { | |
4012 | - $('#tempCanvas').remove(); | |
4013 | - } | |
4014 | - if (document.getElementById('tempCanvas') == null || document.getElementById('tempCanvas') == undefined) { | |
4015 | - var tempCanvas = document.createElement('canvas'); | |
4016 | - tempCanvas.id = 'tempCanvas'; | |
4017 | - // $scope.tempCanvas = transparencyCanvas.id; | |
4018 | - tempCanvas.height = TransparencyBoxEndY - $scope.startY; | |
4019 | - tempCanvas.width = TransparencyEndX - $scope.startX; | |
4020 | - tempCanvas.style.position = "absolute"; | |
4021 | - tempCanvas.style.left = 200 + 'px'; | |
4022 | - tempCanvas.style.top = 200 + 'px'; | |
4023 | - tempCanvas.style.backgroundColor = "transparent"; | |
4024 | - tempCanvas.style.visibility = 'hidden'; | |
4025 | - tempCanvas.style.border = "black 1px solid"; | |
4026 | - document.getElementById('canvasDiv').appendChild(tempCanvas); | |
4027 | - } | |
4024 | + if (previewRectangleWidth == 0 && previewRectangleHeight == 0) { | |
4028 | 4025 | |
4026 | + } | |
4027 | + else { | |
4028 | + $scope.layerNumberBeforeTBDraw = parseInt($('#txtlayerNumber').val()); | |
4029 | 4029 | |
4030 | - $scope.isTransparencyActivated = true; | |
4030 | + //draw temp box to store the canvas data with original transparecy | |
4031 | + if (document.getElementById('tempCanvas') != null) { | |
4032 | + $('#tempCanvas').remove(); | |
4033 | + } | |
4034 | + if (document.getElementById('tempCanvas') == null || document.getElementById('tempCanvas') == undefined) { | |
4035 | + var tempCanvas = document.createElement('canvas'); | |
4036 | + tempCanvas.id = 'tempCanvas'; | |
4037 | + // $scope.tempCanvas = transparencyCanvas.id; | |
4038 | + tempCanvas.height = TransparencyBoxEndY - $scope.startY; | |
4039 | + tempCanvas.width = TransparencyEndX - $scope.startX; | |
4040 | + tempCanvas.style.position = "absolute"; | |
4041 | + tempCanvas.style.left = 200 + 'px'; | |
4042 | + tempCanvas.style.top = 200 + 'px'; | |
4043 | + tempCanvas.style.backgroundColor = "transparent"; | |
4044 | + tempCanvas.style.visibility = 'hidden'; | |
4045 | + tempCanvas.style.border = "black 1px solid"; | |
4046 | + document.getElementById('canvasDiv').appendChild(tempCanvas); | |
4047 | + } | |
4031 | 4048 | |
4032 | - var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData; | |
4033 | 4049 | |
4034 | - $scope.IncludedBodyRegions = []; | |
4035 | - $scope.transparencyDrawnRegions = []; | |
4050 | + $scope.isTransparencyActivated = true; | |
4036 | 4051 | |
4037 | - $.each(BodyRegionDictionary, function (index, value) { | |
4038 | - | |
4052 | + var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData; | |
4039 | 4053 | |
4040 | - var tBoxDimesions = $scope.getTBoxDimesions($scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, value.X, value.Y, value.Height, value.Width); | |
4054 | + $scope.IncludedBodyRegions = []; | |
4055 | + $scope.transparencyDrawnRegions = []; | |
4041 | 4056 | |
4042 | - var transparencyBoxHeight = tBoxDimesions.transparencyBoxHeight; | |
4043 | - var transparencyBoxWidth = tBoxDimesions.transparencyBoxWidth; | |
4044 | - var transparencyBoxBottom = tBoxDimesions.transparencyBoxBottom; | |
4045 | - var transparencyBoxRight = tBoxDimesions.transparencyBoxRight; | |
4046 | - var bodyRegionRight = tBoxDimesions.bodyRegionRight; | |
4047 | - var bodyRegionBottom = tBoxDimesions.bodyRegionBottom; | |
4057 | + $.each(BodyRegionDictionary, function (index, value) { | |
4048 | 4058 | |
4049 | - var transparencyCanvas = document.createElement('canvas'); | |
4050 | - var tBox = document.getElementById('transparencyCanvas'); | |
4051 | - if (tBox == null) { | |
4052 | 4059 | |
4053 | - transparencyCanvas.id = 'transparencyCanvas'; | |
4054 | - $scope.transparencyCanvasId = transparencyCanvas.id; | |
4055 | - transparencyCanvas.height = TransparencyBoxEndY - $scope.startY; | |
4056 | - transparencyCanvas.width = TransparencyEndX - $scope.startX; | |
4057 | - transparencyCanvas.style.position = "absolute"; | |
4058 | - transparencyCanvas.style.left = $scope.startX + 'px' // x + "px"; | |
4059 | - transparencyCanvas.style.top = $scope.startY + "px"//y + "px"; | |
4060 | - transparencyCanvas.style.border = "black 1px solid"; | |
4061 | - transparencyCanvas.style.backgroundColor = "transparent"; | |
4062 | - transparencyCanvas.style.zIndex = 200; | |
4063 | - document.getElementById('canvasDiv').appendChild(transparencyCanvas); | |
4064 | - $scope.transparencyChangeCounter = 0; | |
4060 | + var tBoxDimesions = $scope.getTBoxDimesions($scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, value.X, value.Y, value.Height, value.Width); | |
4065 | 4061 | |
4066 | - $('#transparencyCanvas').resizable({ handles: "e,s,se,w,n,ne,nw,sw", stop: function (event, ui) { resizeTransparencyBox(); }, start: function (event, ui) { clearTransCanvas(); } }); | |
4062 | + var transparencyBoxHeight = tBoxDimesions.transparencyBoxHeight; | |
4063 | + var transparencyBoxWidth = tBoxDimesions.transparencyBoxWidth; | |
4064 | + var transparencyBoxBottom = tBoxDimesions.transparencyBoxBottom; | |
4065 | + var transparencyBoxRight = tBoxDimesions.transparencyBoxRight; | |
4066 | + var bodyRegionRight = tBoxDimesions.bodyRegionRight; | |
4067 | + var bodyRegionBottom = tBoxDimesions.bodyRegionBottom; | |
4067 | 4068 | |
4068 | - $scope.transparencyCanvasHeight = transparencyCanvas.height; | |
4069 | - $scope.transparencyCanvasWidth = transparencyCanvas.width; | |
4069 | + var transparencyCanvas = document.createElement('canvas'); | |
4070 | + var tBox = document.getElementById('transparencyCanvas'); | |
4071 | + if (tBox == null) { | |
4070 | 4072 | |
4071 | - //bind click listener | |
4072 | - transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener); | |
4073 | + transparencyCanvas.id = 'transparencyCanvas'; | |
4074 | + $scope.transparencyCanvasId = transparencyCanvas.id; | |
4075 | + transparencyCanvas.height = TransparencyBoxEndY - $scope.startY; | |
4076 | + transparencyCanvas.width = TransparencyEndX - $scope.startX; | |
4077 | + transparencyCanvas.style.position = "absolute"; | |
4078 | + transparencyCanvas.style.left = $scope.startX + 'px' // x + "px"; | |
4079 | + transparencyCanvas.style.top = $scope.startY + "px"//y + "px"; | |
4080 | + transparencyCanvas.style.border = "black 1px solid"; | |
4081 | + transparencyCanvas.style.backgroundColor = "transparent"; | |
4082 | + transparencyCanvas.style.zIndex = 200; | |
4083 | + document.getElementById('canvasDiv').appendChild(transparencyCanvas); | |
4084 | + $scope.transparencyChangeCounter = 0; | |
4073 | 4085 | |
4074 | - $(".ui-wrapper").css("z-index", "600"); | |
4086 | + $('#transparencyCanvas').resizable({ handles: "e,s,se,w,n,ne,nw,sw", stop: function (event, ui) { resizeTransparencyBox(); }, start: function (event, ui) { clearTransCanvas(); } }); | |
4075 | 4087 | |
4076 | - } | |
4077 | - if ($scope.TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && $scope.TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) { | |
4088 | + $scope.transparencyCanvasHeight = transparencyCanvas.height; | |
4089 | + $scope.transparencyCanvasWidth = transparencyCanvas.width; | |
4078 | 4090 | |
4079 | - $scope.isTBDrawnOnBodyRegion = true; | |
4091 | + //bind click listener | |
4092 | + transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener); | |
4093 | + | |
4094 | + $(".ui-wrapper").css("z-index", "600"); | |
4080 | 4095 | |
4081 | - if (($rootScope.voId == "9" || $rootScope.voId == "11")) { | |
4082 | - if (value.bodyRegionId == "6") { | |
4083 | - $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false); | |
4084 | 4096 | } |
4085 | - else { | |
4097 | + if ($scope.TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && $scope.TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) { | |
4098 | + | |
4099 | + $scope.isTBDrawnOnBodyRegion = true; | |
4100 | + | |
4101 | + if (($rootScope.voId == "9" || $rootScope.voId == "11")) { | |
4102 | + if (value.bodyRegionId == "6") { | |
4103 | + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false); | |
4104 | + } | |
4105 | + else { | |
4106 | + | |
4107 | + } | |
4108 | + } | |
4109 | + else { | |
4110 | + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false); | |
4086 | 4111 | |
4112 | + } | |
4087 | 4113 | } |
4088 | - } | |
4089 | - else { | |
4090 | - $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false); | |
4114 | + }) | |
4091 | 4115 | |
4092 | - } | |
4093 | - } | |
4094 | - }) | |
4116 | + //for modesty | |
4117 | + if ($rootScope.isModestyOn == true && $scope.modestyImageInfo.length > 0) { | |
4118 | + $.each($scope.modestyImageInfo, function (index, value) { | |
4095 | 4119 | |
4096 | - //for modesty | |
4097 | - if ($rootScope.isModestyOn == true && $scope.modestyImageInfo.length > 0) { | |
4098 | - $.each($scope.modestyImageInfo, function (index, value) { | |
4099 | - | |
4100 | - var tBoxDimesions = $scope.getTBoxDimesions($scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, value.x, value.y, value.Height, value.Width); | |
4120 | + var tBoxDimesions = $scope.getTBoxDimesions($scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, value.x, value.y, value.Height, value.Width); | |
4101 | 4121 | |
4102 | - var transparencyBoxHeight = tBoxDimesions.transparencyBoxHeight; | |
4103 | - var transparencyBoxWidth = tBoxDimesions.transparencyBoxWidth; | |
4104 | - var transparencyBoxBottom = tBoxDimesions.transparencyBoxBottom; | |
4105 | - var transparencyBoxRight = tBoxDimesions.transparencyBoxRight; | |
4106 | - var bodyRegionRight = tBoxDimesions.bodyRegionRight; | |
4107 | - var bodyRegionBottom = tBoxDimesions.bodyRegionBottom; | |
4122 | + var transparencyBoxHeight = tBoxDimesions.transparencyBoxHeight; | |
4123 | + var transparencyBoxWidth = tBoxDimesions.transparencyBoxWidth; | |
4124 | + var transparencyBoxBottom = tBoxDimesions.transparencyBoxBottom; | |
4125 | + var transparencyBoxRight = tBoxDimesions.transparencyBoxRight; | |
4126 | + var bodyRegionRight = tBoxDimesions.bodyRegionRight; | |
4127 | + var bodyRegionBottom = tBoxDimesions.bodyRegionBottom; | |
4108 | 4128 | |
4109 | - if ($scope.TransparencyBoxStartX <= bodyRegionRight && value.x <= transparencyBoxRight && $scope.TransparencyBoxStartY <= bodyRegionBottom && value.y <= transparencyBoxBottom) { | |
4129 | + if ($scope.TransparencyBoxStartX <= bodyRegionRight && value.x <= transparencyBoxRight && $scope.TransparencyBoxStartY <= bodyRegionBottom && value.y <= transparencyBoxBottom) { | |
4110 | 4130 | |
4111 | - $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.x, value.y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false); | |
4131 | + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.x, value.y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false); | |
4112 | 4132 | |
4133 | + } | |
4134 | + }) | |
4113 | 4135 | } |
4114 | - }) | |
4115 | - } | |
4116 | 4136 | |
4117 | 4137 | |
4118 | - // | |
4119 | 4138 | |
4120 | - // $('#transparencyScale').modal('show'); | |
4121 | - $('#transparencyScale').css('position', 'fixed') | |
4122 | - $('#transparencyScale').css('top', $scope.TBDrawStartY - 10) | |
4123 | - $('#transparencyScale').css('left', $scope.TBDrawStartX + 130) | |
4124 | - $('#transparencyScale').css('visibility', 'visible') | |
4125 | - $('#transparencyScale').css("z-index", "100000") //Dated:16-07-2016 Issue#4962:Transparency box should be on top. | |
4126 | 4139 | |
4140 | + // | |
4127 | 4141 | |
4142 | + // $('#transparencyScale').modal('show'); | |
4143 | + $('#transparencyScale').css('position', 'fixed') | |
4144 | + $('#transparencyScale').css('top', $scope.TBDrawStartY - 10) | |
4145 | + $('#transparencyScale').css('left', $scope.TBDrawStartX + 130) | |
4146 | + $('#transparencyScale').css('visibility', 'visible') | |
4147 | + $('#transparencyScale').css("z-index", "100000") //Dated:16-07-2016 Issue#4962:Transparency box should be on top. | |
4148 | + | |
4149 | + } | |
4150 | + } | |
4128 | 4151 | |
4129 | 4152 | document.getElementById('canvasDiv').removeEventListener("mousedown", mouseDownListener); |
4130 | 4153 | document.getElementById('canvasDiv').removeEventListener("mousemove", mouseMoveListener); | ... | ... |