Commit d588172049ee3a796df912945e267fb18b0efb3d

Authored by unknown
1 parent 57e58c04

Commit Changes

400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -2944,10 +2944,9 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -2944,10 +2944,9 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2944 $rootScope.iniiaTextAreaValues = []; 2944 $rootScope.iniiaTextAreaValues = [];
2945 $rootScope.initTextAreaValues = []; 2945 $rootScope.initTextAreaValues = [];
2946 $rootScope.textWidth = []; 2946 $rootScope.textWidth = [];
2947 - $rootScope.textWidth1 = []; 2947 + $rootScope.duplicatetextWidth = [];
2948 $rootScope.resieTextArray = []; 2948 $rootScope.resieTextArray = [];
2949 - $rootScope.resieTextArray1 = [];  
2950 - // $rootScope.textWidth1 = []; 2949 + $rootScope.duplicateResizeTextArray = [];
2951 $rootScope.aaaa = 0; 2950 $rootScope.aaaa = 0;
2952 $rootScope.aaaa1 = 0; 2951 $rootScope.aaaa1 = 0;
2953 ///----- 2952 ///-----
@@ -3495,19 +3494,15 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -3495,19 +3494,15 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
3495 $("#duptextspan").append(text[i]); 3494 $("#duptextspan").append(text[i]);
3496 $("#textspan").append(text[i]); 3495 $("#textspan").append(text[i]);
3497 contentWidthArray = []; 3496 contentWidthArray = [];
3498 - if ($rootScope.textWidth1.length > 0) {  
3499 - 3497 + if ($rootScope.duplicatetextWidth.length > 0) {
3500 $rootScope.aaaa1 = $("#textspan").width(); 3498 $rootScope.aaaa1 = $("#textspan").width();
3501 - // alert("Second Time" + $rootScope.aaaa1);  
3502 $rootScope.aaaa1 = $rootScope.aaaa1 - $rootScope.aaaa; 3499 $rootScope.aaaa1 = $rootScope.aaaa1 - $rootScope.aaaa;
3503 $rootScope.aaaa = $rootScope.aaaa + $rootScope.aaaa1; 3500 $rootScope.aaaa = $rootScope.aaaa + $rootScope.aaaa1;
3504 - // alert("Second Time" + $rootScope.aaaa);  
3505 -  
3506 - $rootScope.textWidth1.push({ "id": "", "width": $rootScope.aaaa1, "character": text[i] }); 3501 + $rootScope.duplicatetextWidth.push({ "id": "", "width": $rootScope.aaaa1, "character": text[i] });
3507 } 3502 }
3508 else 3503 else
3509 { 3504 {
3510 - $rootScope.textWidth1.push({ "id": "", "width": $("#textspan").width(), "character": text[i] }); 3505 + $rootScope.duplicatetextWidth.push({ "id": "", "width": $("#textspan").width(), "character": text[i] });
3511 } 3506 }
3512 contentWidthArray.push(Math.ceil($("#textspan").width())); 3507 contentWidthArray.push(Math.ceil($("#textspan").width()));
3513 } 3508 }
@@ -3521,8 +3516,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -3521,8 +3516,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
3521 $rootScope.aaaa = 0; 3516 $rootScope.aaaa = 0;
3522 $rootScope.aaaa1 = 0; 3517 $rootScope.aaaa1 = 0;
3523 $rootScope.aaaa = $("#textspan").width(); 3518 $rootScope.aaaa = $("#textspan").width();
3524 - // alert("New Line" + $rootScope.aaaa);  
3525 - $rootScope.textWidth1.push({ "id": "", "width": $("#textspan").width(), "character": text[i] }); 3519 + $rootScope.duplicatetextWidth.push({ "id": "", "width": $("#textspan").width(), "character": text[i] });
3526 contentWidthArray.push(Math.ceil($("#textspan").width())); 3520 contentWidthArray.push(Math.ceil($("#textspan").width()));
3527 3521
3528 } 3522 }
@@ -3531,12 +3525,12 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -3531,12 +3525,12 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
3531 $("#duptextspan").text(text[i]); 3525 $("#duptextspan").text(text[i]);
3532 $("#textspan").text(text[i]); 3526 $("#textspan").text(text[i]);
3533 contentWidthArray = []; 3527 contentWidthArray = [];
3534 - $rootScope.textWidth1.push({ "id": "", "width": $("#textspan").width(), "character": text[i] }); 3528 + $rootScope.duplicatetextWidth.push({ "id": "", "width": $("#textspan").width(), "character": text[i] });
3535 $rootScope.aaaa = $("#textspan").width(); 3529 $rootScope.aaaa = $("#textspan").width();
3536 contentWidthArray.push(Math.ceil($("#textspan").width())); 3530 contentWidthArray.push(Math.ceil($("#textspan").width()));
3537 } 3531 }
3538 } 3532 }
3539 - console.log($rootScope.textWidth1); 3533 + console.log($rootScope.duplicatetextWidth);
3540 _modifiedText = $("#duptextspan").text(); 3534 _modifiedText = $("#duptextspan").text();
3541 console.log(_modifiedText); 3535 console.log(_modifiedText);
3542 } 3536 }
@@ -3545,12 +3539,11 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -3545,12 +3539,11 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
3545 3539
3546 $("#canvas").removeLayer($rootScope.layerNameArr).drawLayers(); 3540 $("#canvas").removeLayer($rootScope.layerNameArr).drawLayers();
3547 $("#canvas").removeLayer($rootScope.rectTextArr).drawLayers(); 3541 $("#canvas").removeLayer($rootScope.rectTextArr).drawLayers();
3548 -  
3549 $rootScope.resetTextRectSave = $rootScope.ObjectIndexSave++; 3542 $rootScope.resetTextRectSave = $rootScope.ObjectIndexSave++;
3550 $rootScope.resetTextSave = $rootScope.ObjectIndexSave++; 3543 $rootScope.resetTextSave = $rootScope.ObjectIndexSave++;
3551 3544
3552 // generating new text area 3545 // generating new text area
3553 - // $('#canvas') 3546 +
3554 // Draw rect as wide as the text 3547 // Draw rect as wide as the text
3555 $('#canvas').drawRect({ 3548 $('#canvas').drawRect({
3556 name: 'TextAreaAfterEditRect_' + $rootScope.resetTextSave, 3549 name: 'TextAreaAfterEditRect_' + $rootScope.resetTextSave,
@@ -3573,9 +3566,9 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -3573,9 +3566,9 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
3573 $rootScope.postFixLayerNumberAftrEdit = TextAreaLayerNameAftrSplit[1]; 3566 $rootScope.postFixLayerNumberAftrEdit = TextAreaLayerNameAftrSplit[1];
3574 $rootScope.initTextAreaValues.push({ "name": layer.name, "width": layer.width, "height": layer.height }); 3567 $rootScope.initTextAreaValues.push({ "name": layer.name, "width": layer.width, "height": layer.height });
3575 3568
3576 - for (var i = 0; i <= $rootScope.textWidth1.length - 1; i++) {  
3577 - if ($rootScope.textWidth1[i].id == "") {  
3578 - $rootScope.textWidth1[i].id = layer.name; 3569 + for (var i = 0; i <= $rootScope.duplicatetextWidth.length - 1; i++) {
  3570 + if ($rootScope.duplicatetextWidth[i].id == "") {
  3571 + $rootScope.duplicatetextWidth[i].id = layer.name;
3579 } 3572 }
3580 } 3573 }
3581 3574
@@ -3797,31 +3790,27 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -3797,31 +3790,27 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
3797 x: layer.x, 3790 x: layer.x,
3798 y: layer.y 3791 y: layer.y
3799 }); 3792 });
3800 -  
3801 -  
3802 -  
3803 -  
3804 $("#textspan").empty(); 3793 $("#textspan").empty();
3805 $("#duptextspan").empty(); 3794 $("#duptextspan").empty();
3806 var textWidthCounter = 0; 3795 var textWidthCounter = 0;
3807 var textAftrResize; 3796 var textAftrResize;
3808 - for (var i = 0; i <= $rootScope.resieTextArray1.length - 1; i++) {  
3809 - if ($rootScope.resieTextArray1[i].layerName == CangedTextAreaName) {  
3810 - if (/(\r\n)/gm.test($rootScope.resieTextArray1[i].Rect_Text) || /\s/.test($rootScope.resieTextArray1[i].Rect_Text)) {  
3811 - textAftrResize = ($rootScope.resieTextArray1[i].Rect_Text).replace(/(\r\n)/gm, "");  
3812 - for (var i = 0; i <= $rootScope.textWidth1.length - 1; i++) {  
3813 - if ($rootScope.textWidth1[i].id == layer.name) {  
3814 - textWidthCounter = textWidthCounter + $rootScope.textWidth1[i].width; 3797 + for (var i = 0; i <= $rootScope.duplicateResizeTextArray.length - 1; i++) {
  3798 + if ($rootScope.duplicateResizeTextArray[i].layerName == CangedTextAreaName) {
  3799 + if (/(\r\n)/gm.test($rootScope.duplicateResizeTextArray[i].Rect_Text) || /\s/.test($rootScope.duplicateResizeTextArray[i].Rect_Text)) {
  3800 + textAftrResize = ($rootScope.duplicateResizeTextArray[i].Rect_Text).replace(/(\r\n)/gm, "");
  3801 + for (var i = 0; i <= $rootScope.duplicatetextWidth.length - 1; i++) {
  3802 + if ($rootScope.duplicatetextWidth[i].id == layer.name) {
  3803 + textWidthCounter = textWidthCounter + $rootScope.duplicatetextWidth[i].width;
3815 if (textWidthCounter < layer.width) { 3804 if (textWidthCounter < layer.width) {
3816 - $("#duptextspan").append($rootScope.textWidth1[i].character);  
3817 - $("#textspan").append($rootScope.textWidth1[i].character); 3805 + $("#duptextspan").append($rootScope.duplicatetextWidth[i].character);
  3806 + $("#textspan").append($rootScope.duplicatetextWidth[i].character);
3818 } 3807 }
3819 else { 3808 else {
3820 $("#duptextspan").append("\r\n"); 3809 $("#duptextspan").append("\r\n");
3821 $("#textspan").append("\r\n"); 3810 $("#textspan").append("\r\n");
3822 - $("#duptextspan").append($rootScope.textWidth1[i].character); 3811 + $("#duptextspan").append($rootScope.duplicatetextWidth[i].character);
3823 $("#textspan").text(''); 3812 $("#textspan").text('');
3824 - $("#textspan").append($rootScope.textWidth1[i].character); 3813 + $("#textspan").append($rootScope.duplicatetextWidth[i].character);
3825 textWidthCounter = 0; 3814 textWidthCounter = 0;
3826 } 3815 }
3827 } 3816 }
@@ -3834,11 +3823,6 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -3834,11 +3823,6 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
3834 } 3823 }
3835 } 3824 }
3836 3825
3837 -  
3838 -  
3839 -  
3840 -  
3841 -  
3842 } 3826 }
3843 } 3827 }
3844 3828
@@ -3887,7 +3871,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -3887,7 +3871,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
3887 // console.log(layer.x + " " + layer.y); 3871 // console.log(layer.x + " " + layer.y);
3888 $rootScope.editTextXAxisAftrResize = layer.x; 3872 $rootScope.editTextXAxisAftrResize = layer.x;
3889 $rootScope.editTextYAxisAftrResize = layer.y; 3873 $rootScope.editTextYAxisAftrResize = layer.y;
3890 - $rootScope.resieTextArray1.push({ layerName: layer.name, Rect_Text: layer.text }); 3874 + $rootScope.duplicateResizeTextArray.push({ layerName: layer.name, Rect_Text: layer.text });
3891 } 3875 }
3892 }); 3876 });
3893 3877