Commit 3555617d35a4eb87f7ae24ab49933cfc33b5252e

Authored by Nikita Kulshreshtha
2 parents 25984d9d 16b60d99

Merge branch 'TextAreaResizingIssue' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -1956,13 +1956,17 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -1956,13 +1956,17 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
1956 width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width, 1956 width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
1957 height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height, 1957 height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
1958 resizeFromCenter: false, 1958 resizeFromCenter: false,
  1959 + add: function (layer) {
  1960 + var TextAreaLayerName = layer.name;
  1961 + var TextAreaLayerNameAftrSplit = TextAreaLayerName.split("_");
  1962 + $rootScope.postFixLayerNumber = TextAreaLayerNameAftrSplit[1];
  1963 + },
1959 click: function (layer) { 1964 click: function (layer) {
1960 1965
1961 if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) { 1966 if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
1962 //jcanvas property 1967 //jcanvas property
1963 layer.draggable = true; 1968 layer.draggable = true;
1964 $rootScope.shapeTypeText = "textAreaRect"; 1969 $rootScope.shapeTypeText = "textAreaRect";
1965 -  
1966 var layerName = layer.name; 1970 var layerName = layer.name;
1967 var splitedName = layerName.split("_"); 1971 var splitedName = layerName.split("_");
1968 var textValName = "TextAreaNew_"; 1972 var textValName = "TextAreaNew_";
@@ -1975,7 +1979,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -1975,7 +1979,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
1975 fillStyle: '#fff', 1979 fillStyle: '#fff',
1976 strokeStyle: '#c33', 1980 strokeStyle: '#c33',
1977 strokeWidth: 2, 1981 strokeWidth: 2,
1978 - width: 5, height: 5, 1982 + width: 7, height: 7,
1979 cornerRadius: 3 1983 cornerRadius: 3
1980 1984
1981 } 1985 }
@@ -2151,7 +2155,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -2151,7 +2155,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2151 //jcanvas property 2155 //jcanvas property
2152 layer.draggable = false; 2156 layer.draggable = false;
2153 } 2157 }
2154 - 2158 +
2155 }, 2159 },
2156 mouseover: function (layer) { 2160 mouseover: function (layer) {
2157 if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) { 2161 if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
@@ -2163,8 +2167,11 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -2163,8 +2167,11 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2163 fillStyle: '#fff', 2167 fillStyle: '#fff',
2164 strokeStyle: '#c33', 2168 strokeStyle: '#c33',
2165 strokeWidth: 2, 2169 strokeWidth: 2,
2166 - width: 5, height: 5,  
2167 - cornerRadius: 3 2170 + width: 7, height: 7,
  2171 + cornerRadius: 3,
  2172 + click: function () {
  2173 + $rootScope.isTextAReaRectangleClicked = true;
  2174 + }
2168 2175
2169 } 2176 }
2170 }).drawLayers(); 2177 }).drawLayers();
@@ -2173,7 +2180,28 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -2173,7 +2180,28 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2173 //jcanvas property 2180 //jcanvas property
2174 layer.draggable = false; 2181 layer.draggable = false;
2175 } 2182 }
  2183 + },
  2184 + change: function (layer) {
  2185 +
  2186 + if ($rootScope.isTextAReaRectangleClicked == true) {
  2187 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2188 + console.log(layer.x + " " + layer.y);
  2189 + console.log($rootScope.textXAxisAftrResize + " " + $rootScope.textYAxisAftrResize);
  2190 + $rootScope.isTextAReaRectangleClicked = false;
  2191 + //if ((layer.x > $rootScope.textXAxisAftrResize) && (layer.y > $rootScope.textYAxisAftrResize) || (layer.x == $rootScope.textXAxisAftrResize) && (layer.y > $rootScope.textYAxisAftrResize) || (layer.x > $rootScope.textXAxisAftrResize) && (layer.y == $rootScope.textYAxisAftrResize)) {
  2192 + var CangedTextAreaName = 'TextAreaNew_' + $rootScope.postFixLayerNumber;
  2193 + $('#canvas').setLayer(CangedTextAreaName, {
  2194 + x: layer.x,
  2195 + y: layer.y
  2196 + });
  2197 +
  2198 + //}
  2199 + $rootScope.textXAxisAftrResize = layer.x;
  2200 + $rootScope.textYAxisAftrResize = layer.y;
  2201 + }
  2202 + }
2176 } 2203 }
  2204 +
2177 }).drawText({ 2205 }).drawText({
2178 layer: true, 2206 layer: true,
2179 draggable: true, 2207 draggable: true,
@@ -2188,11 +2216,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -2188,11 +2216,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2188 align: $rootScope.textAlignmt, 2216 align: $rootScope.textAlignmt,
2189 strokeWidth: 0, 2217 strokeWidth: 0,
2190 text: $rootScope.textArea, 2218 text: $rootScope.textArea,
2191 - x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y, 2219 + x: ($rootScope.rectDimension[$rootScope.rectDimension.length - 1].x), y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
2192 maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width, 2220 maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
2193 maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height, 2221 maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
2194 add: function (layer) { 2222 add: function (layer) {
2195 - 2223 + // console.log(layer.x + " " + layer.y);
  2224 + $rootScope.textXAxisAftrResize = layer.x;
  2225 + $rootScope.textYAxisAftrResize = layer.y;
  2226 +
2196 //$rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' }); 2227 //$rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' });
2197 $rootScope.TextPropertyArray.push({ layerName: layer.name, Rect_Text: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily, TextDecoration: $rootScope.underlineText }); 2228 $rootScope.TextPropertyArray.push({ layerName: layer.name, Rect_Text: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily, TextDecoration: $rootScope.underlineText });
2198 } 2229 }
@@ -2265,7 +2296,11 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -2265,7 +2296,11 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2265 width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width, 2296 width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
2266 height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height, 2297 height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
2267 resizeFromCenter: false, 2298 resizeFromCenter: false,
2268 - 2299 + add: function (layer) {
  2300 + var TextAreaLayerName = layer.name;
  2301 + var TextAreaLayerNameAftrSplit = TextAreaLayerName.split("_");
  2302 + $rootScope.postFixLayerNumberAftrEdit = TextAreaLayerNameAftrSplit[1];
  2303 + },
2269 click: function (layer) { 2304 click: function (layer) {
2270 if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) { 2305 if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2271 //jcanvas property 2306 //jcanvas property
@@ -2284,7 +2319,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -2284,7 +2319,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2284 fillStyle: '#fff', 2319 fillStyle: '#fff',
2285 strokeStyle: '#c33', 2320 strokeStyle: '#c33',
2286 strokeWidth: 2, 2321 strokeWidth: 2,
2287 - width: 5, height: 5, 2322 + width: 7, height: 7,
2288 cornerRadius: 3 2323 cornerRadius: 3
2289 } 2324 }
2290 }).drawLayers(); 2325 }).drawLayers();
@@ -2412,7 +2447,8 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -2412,7 +2447,8 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2412 //jcanvas property 2447 //jcanvas property
2413 layer.draggable = false; 2448 layer.draggable = false;
2414 } 2449 }
2415 - 2450 + $rootScope.RectXAxisAftrResize = layer.x;
  2451 + $rootScope.RectYAxisAftrResize = layer.y;
2416 }, 2452 },
2417 mouseover: function (layer) { 2453 mouseover: function (layer) {
2418 if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) { 2454 if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
@@ -2424,8 +2460,11 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -2424,8 +2460,11 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2424 fillStyle: '#fff', 2460 fillStyle: '#fff',
2425 strokeStyle: '#c33', 2461 strokeStyle: '#c33',
2426 strokeWidth: 2, 2462 strokeWidth: 2,
2427 - width: 5, height: 5,  
2428 - cornerRadius: 3 2463 + width: 7, height: 7,
  2464 + cornerRadius: 3,
  2465 + click: function () {
  2466 + $rootScope.isTextAReaRectangleClickedAftrEdit = true;
  2467 + }
2429 } 2468 }
2430 }).drawLayers(); 2469 }).drawLayers();
2431 2470
@@ -2435,6 +2474,26 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -2435,6 +2474,26 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2435 //jcanvas property 2474 //jcanvas property
2436 layer.draggable = false; 2475 layer.draggable = false;
2437 } 2476 }
  2477 + },
  2478 + change: function (layer) {
  2479 +
  2480 + if ($rootScope.isTextAReaRectangleClickedAftrEdit == true) {
  2481 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2482 + console.log(layer.x + " " + layer.y);
  2483 + console.log($rootScope.textXAxisAftrResize + " " + $rootScope.textYAxisAftrResize);
  2484 + $rootScope.isTextAReaRectangleClickedAftrEdit = false;
  2485 + //if ((layer.x > $rootScope.textXAxisAftrResize) && (layer.y > $rootScope.textYAxisAftrResize) || (layer.x == $rootScope.textXAxisAftrResize) && (layer.y > $rootScope.textYAxisAftrResize) || (layer.x > $rootScope.textXAxisAftrResize) && (layer.y == $rootScope.textYAxisAftrResize)) {
  2486 + var CangedTextAreaName = 'TextAreaAfterEdit_' + $rootScope.postFixLayerNumberAftrEdit;
  2487 + $('#canvas').setLayer(CangedTextAreaName, {
  2488 + x: layer.x,
  2489 + y: layer.y
  2490 + });
  2491 +
  2492 + //}
  2493 + $rootScope.editTextXAxisAftrResize = layer.x;
  2494 + $rootScope.editTextYAxisAftrResize = layer.y;
  2495 + }
  2496 + }
2438 } 2497 }
2439 2498
2440 }).drawText({ 2499 }).drawText({
@@ -2453,8 +2512,12 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -2453,8 +2512,12 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2453 text: _modifiedText, 2512 text: _modifiedText,
2454 x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y, 2513 x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
2455 maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width, 2514 maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
2456 - maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height  
2457 - 2515 + maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
  2516 + add: function (layer) {
  2517 + // console.log(layer.x + " " + layer.y);
  2518 + $rootScope.editTextXAxisAftrResize = layer.x;
  2519 + $rootScope.editTextYAxisAftrResize = layer.y;
  2520 + }
2458 }); 2521 });
2459 2522
2460 } 2523 }