Commit 16b60d999ea6fd54d27c00259b7f5cbd0c168171

Authored by unknown
1 parent ccdada3c

DA > Annotation Toolbar > Resizing the box, takes the text out of it.

400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -1956,13 +1956,17 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
1956 1956 width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
1957 1957 height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
1958 1958 resizeFromCenter: false,
  1959 + add: function (layer) {
  1960 + var TextAreaLayerName = layer.name;
  1961 + var TextAreaLayerNameAftrSplit = TextAreaLayerName.split("_");
  1962 + $rootScope.postFixLayerNumber = TextAreaLayerNameAftrSplit[1];
  1963 + },
1959 1964 click: function (layer) {
1960 1965  
1961 1966 if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
1962 1967 //jcanvas property
1963 1968 layer.draggable = true;
1964 1969 $rootScope.shapeTypeText = "textAreaRect";
1965   -
1966 1970 var layerName = layer.name;
1967 1971 var splitedName = layerName.split("_");
1968 1972 var textValName = "TextAreaNew_";
... ... @@ -1975,7 +1979,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
1975 1979 fillStyle: '#fff',
1976 1980 strokeStyle: '#c33',
1977 1981 strokeWidth: 2,
1978   - width: 5, height: 5,
  1982 + width: 7, height: 7,
1979 1983 cornerRadius: 3
1980 1984  
1981 1985 }
... ... @@ -2151,7 +2155,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2151 2155 //jcanvas property
2152 2156 layer.draggable = false;
2153 2157 }
2154   -
  2158 +
2155 2159 },
2156 2160 mouseover: function (layer) {
2157 2161 if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
... ... @@ -2163,8 +2167,11 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2163 2167 fillStyle: '#fff',
2164 2168 strokeStyle: '#c33',
2165 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 2177 }).drawLayers();
... ... @@ -2173,7 +2180,28 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2173 2180 //jcanvas property
2174 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 2205 }).drawText({
2178 2206 layer: true,
2179 2207 draggable: true,
... ... @@ -2188,11 +2216,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2188 2216 align: $rootScope.textAlignmt,
2189 2217 strokeWidth: 0,
2190 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 2220 maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
2193 2221 maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
2194 2222 add: function (layer) {
2195   -
  2223 + // console.log(layer.x + " " + layer.y);
  2224 + $rootScope.textXAxisAftrResize = layer.x;
  2225 + $rootScope.textYAxisAftrResize = layer.y;
  2226 +
2196 2227 //$rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' });
2197 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 2296 width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
2266 2297 height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
2267 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 2304 click: function (layer) {
2270 2305 if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2271 2306 //jcanvas property
... ... @@ -2284,7 +2319,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2284 2319 fillStyle: '#fff',
2285 2320 strokeStyle: '#c33',
2286 2321 strokeWidth: 2,
2287   - width: 5, height: 5,
  2322 + width: 7, height: 7,
2288 2323 cornerRadius: 3
2289 2324 }
2290 2325 }).drawLayers();
... ... @@ -2412,7 +2447,8 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2412 2447 //jcanvas property
2413 2448 layer.draggable = false;
2414 2449 }
2415   -
  2450 + $rootScope.RectXAxisAftrResize = layer.x;
  2451 + $rootScope.RectYAxisAftrResize = layer.y;
2416 2452 },
2417 2453 mouseover: function (layer) {
2418 2454 if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
... ... @@ -2424,8 +2460,11 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2424 2460 fillStyle: '#fff',
2425 2461 strokeStyle: '#c33',
2426 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 2469 }).drawLayers();
2431 2470  
... ... @@ -2435,6 +2474,26 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2435 2474 //jcanvas property
2436 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 2499 }).drawText({
... ... @@ -2453,8 +2512,12 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2453 2512 text: _modifiedText,
2454 2513 x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
2455 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 }
... ...