From b51b2ae275ceb98ba4ff36a5c36b5c7d3b49c938 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Dec 2016 11:56:17 +0530 Subject: [PATCH] Commit Changes for textarea --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js | 734 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1 file changed, 379 insertions(+), 355 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 08458a2..0317a81 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -541,62 +541,67 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", //--Common code of Annotation Toolbar for CI and DA------- $rootScope.LineFn = function (canvasId, LineNumber, shapestyleborderColor, shapestyleborderWidth, offsetX1, offsetY1, x, y) { - $(canvasId).addLayer({ - name: 'Line_' + LineNumber, - layer: true, - type: 'line', - draggable: true, - strokeStyle: shapestyleborderColor, - strokeWidth: shapestyleborderWidth, - rounded: true, - x1: offsetX1, y1: offsetY1, - x2: x, y2: y, - - click: function (layer) { - $rootScope.canvasLayerNameCollection = []; - $rootScope.canvasLayerNameCollection.push(layer.name); - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - radius: 3 - } - }).drawLayers(); - - - }, - mouseout: function (layer) { - $rootScope.canvasLayerNameCollection = []; - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 0, - radius: 0 - } - - }).drawLayers(); - - }, - mouseover: function (layer) { - - - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - radius: 3 - } - }).drawLayers(); + if ($rootScope.islineMoved == true) { + $rootScope.islineMoved = false; + $(canvasId).addLayer({ + name: 'Line_' + LineNumber, + layer: true, + type: 'line', + draggable: true, + strokeStyle: shapestyleborderColor, + strokeWidth: shapestyleborderWidth, + rounded: true, + x1: offsetX1, y1: offsetY1, + x2: x, y2: y, + + click: function (layer) { + $rootScope.canvasLayerNameCollection = []; + $rootScope.canvasLayerNameCollection.push(layer.name); + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + radius: 3 + } + }).drawLayers(); - } - }).drawLayers(); + }, + mouseout: function (layer) { + $rootScope.canvasLayerNameCollection = []; + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 0, + radius: 0 + } + + }).drawLayers(); + + }, + mouseover: function (layer) { + + + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + radius: 3 + } + }).drawLayers(); + + } + + }).drawLayers(); + + } + $('.btnCursor').trigger('click'); $(".btn-annotation").removeClass("activebtncolor"); @@ -604,74 +609,77 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } $rootScope.RectangleFn = function (canvasId, RectNumber, shapestyleFillColor, shapestyleborderColor, shapestyleOpacity, shapestyleborderWidth, offsetX1, offsetY1, x, y) { - $(canvasId).addLayer({ - layer: true, - name: 'Rect_' + RectNumber, - fillStyle: shapestyleFillColor, - type: 'rectangle', - draggable: true, - strokeStyle: shapestyleborderColor, - opacity: shapestyleOpacity, - strokeWidth: shapestyleborderWidth, - x: offsetX1, y: offsetY1, - width: (x - offsetX1) * 2, - height: (y - offsetY1) * 2, - - resizeFromCenter: false, - - dblclick: function () { - // $rootScope.backOpacity(); - - }, - - click: function (layer) { - $rootScope.canvasLayerNameCollection = []; - $rootScope.canvasLayerNameCollection.push(layer.name); - $(canvasId).setLayer(layer.name, { - handle: { - type: 'rectangle', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - width: 5, height: 5, - cornerRadius: 3 - } - }).drawLayers(); - - }, - mouseout: function (layer) { - $rootScope.canvasLayerNameCollection = []; - $(canvasId).setLayer(layer.name, { - handle: { - type: 'rectangle', - fillStyle: 'pink', - strokeStyle: 'yellow', - strokeWidth: 0, - width: 0, height: 0, - cornerRadius: 0 - } - - }).drawLayers(); - - }, - mouseover: function (layer) { - - - $(canvasId).setLayer(layer.name, { - handle: { - type: 'rectangle', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - width: 5, height: 5, - cornerRadius: 3 - } - }).drawLayers(); + if ($rootScope.isrectangleMoved == true) { + $rootScope.isrectangleMoved = false; + $(canvasId).addLayer({ + layer: true, + name: 'Rect_' + RectNumber, + fillStyle: shapestyleFillColor, + type: 'rectangle', + draggable: true, + strokeStyle: shapestyleborderColor, + opacity: shapestyleOpacity, + strokeWidth: shapestyleborderWidth, + fromCenter: false, + x: offsetX1, y: offsetY1, + width: (x - offsetX1), + height: (y - offsetY1), - } - }).drawLayers(); + resizeFromCenter: false, + dblclick: function () { + // $rootScope.backOpacity(); + }, + + click: function (layer) { + $rootScope.canvasLayerNameCollection = []; + $rootScope.canvasLayerNameCollection.push(layer.name); + $(canvasId).setLayer(layer.name, { + handle: { + type: 'rectangle', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + width: 5, height: 5, + cornerRadius: 3 + } + }).drawLayers(); + + }, + mouseout: function (layer) { + $rootScope.canvasLayerNameCollection = []; + $(canvasId).setLayer(layer.name, { + handle: { + type: 'rectangle', + fillStyle: 'pink', + strokeStyle: 'yellow', + strokeWidth: 0, + width: 0, height: 0, + cornerRadius: 0 + } + + }).drawLayers(); + + }, + mouseover: function (layer) { + + + $(canvasId).setLayer(layer.name, { + handle: { + type: 'rectangle', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + width: 5, height: 5, + cornerRadius: 3 + } + }).drawLayers(); + + } + }).drawLayers(); + + } $('.btnCursor').trigger('click'); $(".btn-annotation").removeClass("activebtncolor"); @@ -681,133 +689,140 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.CircleFn = function (canvasId, CircleNumber, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, offsetX1, offsetY1, x, y) { // console.log("up"+ offsetX1 + " " + offsetY1 + " " + (x - offsetX1) + " " + (y - offsetY1)); - $(canvasId).addLayer({ - layer: true, - name: 'Circle_' + CircleNumber, - type: 'ellipse', - opacity: shapestyleOpacity, - draggable: true, - strokeStyle: shapestyleborderColor, - strokeWidth: shapestyleborderWidth, - fillStyle: shapestyleFillColor, - x: (offsetX1), y: (offsetY1), - width: (x - offsetX1) * 2, height: (y - offsetY1) * 2, - // Place a handle at each side and each corner - handlePlacement: 'both', - click: function (layer) { - $rootScope.canvasLayerNameCollection = []; - $rootScope.canvasLayerNameCollection.push(layer.name); - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - radius: 3 - } - }).drawLayers(); - - }, - mouseout: function (layer) { - $rootScope.canvasLayerNameCollection = []; - - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 0, - // width: 0, height: 0, - radius: 0 - } - - }).drawLayers(); - - }, - mouseover: function (layer) { - - - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - // width: 5, height: 5, - radius: 3 - } - }).drawLayers(); + if ($rootScope.iscircleMoved == true) { + $rootScope.iscircleMoved = false; + $(canvasId).addLayer({ + layer: true, + name: 'Circle_' + CircleNumber, + type: 'ellipse', + opacity: shapestyleOpacity, + draggable: true, + strokeStyle: shapestyleborderColor, + strokeWidth: shapestyleborderWidth, + fillStyle: shapestyleFillColor, + fromCenter: false, + x: (offsetX1), y: (offsetY1), + width: (x - offsetX1), height: (y - offsetY1), + // Place a handle at each side and each corner + handlePlacement: 'both', + click: function (layer) { + $rootScope.canvasLayerNameCollection = []; + $rootScope.canvasLayerNameCollection.push(layer.name); + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + radius: 3 + } + }).drawLayers(); - } - }).drawLayers(); + }, + mouseout: function (layer) { + $rootScope.canvasLayerNameCollection = []; + + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 0, + // width: 0, height: 0, + radius: 0 + } + + }).drawLayers(); + + }, + mouseover: function (layer) { + + + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + // width: 5, height: 5, + radius: 3 + } + }).drawLayers(); + + } + }).drawLayers(); + } $('.btnCursor').trigger('click'); $(".btn-annotation").removeClass("activebtncolor"); $('.btnCursor').addClass('activebtncolor'); } $rootScope.ArrowFn = function (canvasId, ArrowNumber, shapestyleborderColor, shapestyleborderWidth, offsetX1, offsetY1, x, y) { + if ($rootScope.isarrowMoved == true) { + $rootScope.isarrowMoved = false; + $('#canvas').drawLine({ + layer: true, + name: 'Arrow_' + ArrowNumber, + draggable: true, + strokeStyle: shapestyleborderColor, + strokeWidth: shapestyleborderWidth, + rounded: true, + startArrow: true, + arrowRadius: 7, + arrowAngle: 90, + x1: offsetX1, y1: offsetY1, + x2: x, y2: y, - $('#canvas').drawLine({ - layer: true, - name: 'Arrow_' + ArrowNumber, - draggable: true, - strokeStyle: shapestyleborderColor, - strokeWidth: shapestyleborderWidth, - rounded: true, - startArrow: true, - arrowRadius: 7, - arrowAngle: 90, - x1: offsetX1, y1: offsetY1, - x2: x, y2: y, - - click: function (layer) { - $rootScope.canvasLayerNameCollection = []; - $rootScope.canvasLayerNameCollection.push(layer.name); - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - // width: 5, height: 5, - radius: 3 - } - }).drawLayers(); - // $("#canvas").removeLayer(layer.name).drawLayers(); - - }, - mouseout: function (layer) { - $rootScope.canvasLayerNameCollection = []; - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 0, - // width: 0, height: 0, - radius: 0 - } - - }).drawLayers(); - - }, - mouseover: function (layer) { - - - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - // width: 5, height: 5, - radius: 3 - } - }).drawLayers(); + click: function (layer) { + $rootScope.canvasLayerNameCollection = []; + $rootScope.canvasLayerNameCollection.push(layer.name); + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + // width: 5, height: 5, + radius: 3 + } + }).drawLayers(); + // $("#canvas").removeLayer(layer.name).drawLayers(); - } + }, + mouseout: function (layer) { + $rootScope.canvasLayerNameCollection = []; + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 0, + // width: 0, height: 0, + radius: 0 + } - }); + }).drawLayers(); + + }, + mouseover: function (layer) { + + + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + // width: 5, height: 5, + radius: 3 + } + }).drawLayers(); + + } + + }); + } + $('.btnCursor').trigger('click'); $(".btn-annotation").removeClass("activebtncolor"); $('.btnCursor').addClass('activebtncolor'); @@ -815,10 +830,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.PinFn = function (canvasId, PinNumber, offsetX1, offsetY1, x, y, PinArcNumber) { - var xAxisPinDiff = offsetX1 - x; - var yAxisPinDiff = offsetY1 - y; - if (xAxisPinDiff != 0 && yAxisPinDiff != 0) { - + if ($rootScope.isPinMoved == true) { + $rootScope.isPinMoved = false; var radial = $('#canvas').createGradient({ x1: 50, y1: 50, x2: 50, y2: 50, @@ -930,10 +943,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } $rootScope.TextAreaFn = function (canvasId, TextNumber, offsetX1, offsetY1, resetTextRect, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, x, y) { - - - // debugger; - + if ($rootScope.istextAreaMoved == true) { + $rootScope.istextAreaMoved = false; $('#canvas').drawText({ layer: true, draggable: true, @@ -944,6 +955,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", fillStyle: '#36c', strokeWidth: 0, x: $rootScope.offsetX1, y: $rootScope.offsetY1, + fromCenter: false, fontSize: '14pt', align: "left", fontFamily: 'Verdana, sans-serif', @@ -955,117 +967,119 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", }) - // Draw rect as wide as the text - .drawRect({ - layer: true, - name: "TextRect_" + $rootScope.TextNumber, - dragGroups: ['shapes'], - opacity: $rootScope.shapestyleOpacity, - strokeStyle: $rootScope.shapestyleborderColor, - strokeWidth: $rootScope.shapestyleborderWidth, - fillStyle: $rootScope.shapestyleFillColor, - x: $rootScope.offsetX1, y: $rootScope.offsetY1, - width: ($rootScope.x - $rootScope.offsetX1) * 2, - height: ($rootScope.y - $rootScope.offsetY1) * 2, - add: function (layer) { - - $rootScope.TextAreaRectID = layer.name; - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); - $rootScope.CurrentWidth = layer.width; - $rootScope.CurrentHeight = layer.height; - - }, - click: function (layer) { - - $rootScope.canvasLayerNameCollection = []; - $rootScope.canvasLayerNameCollection.push(layer.name); - $('#canvas').setLayer(layer.name, { - handle: { - type: 'rectangle', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - width: 5, height: 5, - cornerRadius: 3 - } - }).drawLayers(); - - }, - dblclick: function (layer) { - - $rootScope.IsTextAlreadySave = false; - var RectNameArray = (layer.name).split("_"); - - var TextAreaRectangleName = "TextArea_"; - var TextAreaRectNameConcat = TextAreaRectangleName.concat(RectNameArray[1]); - $rootScope.TextAreaRectID = layer.name; - $rootScope.TextID = TextAreaRectNameConcat; - - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); - $("#annotationTextModal").css("padding-right", "0px"); - document.getElementById('modelbackground').style.display = "block"; - $("#annotationTextModal").modal("toggle"); - - $("#text_area").val(''); - $("#text_area").css({ "font-family": "Arial", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" }); - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" }); - // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation"); - - $("#selected-font-family option:eq(0)").prop('selected', true); - $("#selected-font-size option:eq(0)").prop('selected', true); - - $("#text-italic").removeClass("ActiveFormattingButtonClass"); - - $("#text-bold").removeClass("ActiveFormattingButtonClass"); - - $("#text-underline").removeClass("ActiveFormattingButtonClass"); - - $("#text-left").removeClass("ActiveFormattingButtonClass"); - - $("#text-right").removeClass("ActiveFormattingButtonClass"); - - $("#text-center").removeClass("ActiveFormattingButtonClass"); - - }, - mouseout: function (layer) { - $rootScope.canvasLayerNameCollection = []; - $('#canvas').setLayer(layer.name, { - handle: { - type: 'rectangle', - fillStyle: 'pink', - strokeStyle: 'yellow', - strokeWidth: 0, - width: 0, height: 0, - cornerRadius: 0 - } - - }).drawLayers(); - - }, - mouseover: function (layer) { - - $('#canvas').setLayer(layer.name, { - handle: { - type: 'rectangle', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - width: 5, height: 5, - cornerRadius: 3 - } - }).drawLayers(); - - } - }); + // Draw rect as wide as the text + .drawRect({ + layer: true, + name: "TextRect_" + $rootScope.TextNumber, + dragGroups: ['shapes'], + opacity: $rootScope.shapestyleOpacity, + strokeStyle: $rootScope.shapestyleborderColor, + fromCenter: false, + strokeWidth: $rootScope.shapestyleborderWidth, + fillStyle: $rootScope.shapestyleFillColor, + x: $rootScope.offsetX1, y: $rootScope.offsetY1, + width: ($rootScope.x - $rootScope.offsetX1), + height: ($rootScope.y - $rootScope.offsetY1), + add: function (layer) { + + $rootScope.TextAreaRectID = layer.name; + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); + // $rootScope.CurrentWidth = layer.width; + // $rootScope.CurrentHeight = layer.height; + + }, + click: function (layer) { + + $rootScope.canvasLayerNameCollection = []; + $rootScope.canvasLayerNameCollection.push(layer.name); + $('#canvas').setLayer(layer.name, { + handle: { + type: 'rectangle', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + width: 5, height: 5, + cornerRadius: 3 + } + }).drawLayers(); + + }, + dblclick: function (layer) { + + $rootScope.IsTextAlreadySave = false; + var RectNameArray = (layer.name).split("_"); + + var TextAreaRectangleName = "TextArea_"; + var TextAreaRectNameConcat = TextAreaRectangleName.concat(RectNameArray[1]); + $rootScope.TextAreaRectID = layer.name; + $rootScope.TextID = TextAreaRectNameConcat; + + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); + $("#annotationTextModal").css("padding-right", "0px"); + document.getElementById('modelbackground').style.display = "block"; + $("#annotationTextModal").modal("toggle"); + + $("#text_area").val(''); + $("#text_area").css({ "font-family": "Arial", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" }); + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" }); + // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation"); + + $("#selected-font-family option:eq(0)").prop('selected', true); + $("#selected-font-size option:eq(0)").prop('selected', true); + + $("#text-italic").removeClass("ActiveFormattingButtonClass"); + + $("#text-bold").removeClass("ActiveFormattingButtonClass"); + + $("#text-underline").removeClass("ActiveFormattingButtonClass"); + + $("#text-left").removeClass("ActiveFormattingButtonClass"); + + $("#text-right").removeClass("ActiveFormattingButtonClass"); + + $("#text-center").removeClass("ActiveFormattingButtonClass"); + + }, + mouseout: function (layer) { + $rootScope.canvasLayerNameCollection = []; + $('#canvas').setLayer(layer.name, { + handle: { + type: 'rectangle', + fillStyle: 'pink', + strokeStyle: 'yellow', + strokeWidth: 0, + width: 0, height: 0, + cornerRadius: 0 + } + + }).drawLayers(); + + }, + mouseover: function (layer) { + + $('#canvas').setLayer(layer.name, { + handle: { + type: 'rectangle', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + width: 5, height: 5, + cornerRadius: 3 + } + }).drawLayers(); + + } + }); + + + // Annotation: Edit Text option is missing. - // alert($rootScope.CurrentWidth); - // alert($rootScope.CurrentHeight); $("#annotationTextModal").css("padding-right", "0px"); - if (($rootScope.CurrentWidth > 0 && $rootScope.CurrentHeight > 0) || ($rootScope.CurrentWidth > 0 && $rootScope.CurrentHeight <= 0) || ($rootScope.CurrentWidth <= 0 && $rootScope.CurrentHeight > 0)) { - $("#annotationTextModal").modal("toggle"); - document.getElementById('modelbackground').style.display = "block"; - } - $('.btnCursor').trigger('click'); + $("#annotationTextModal").modal("toggle"); + document.getElementById('modelbackground').style.display = "block"; + + } + $('.btnCursor').trigger('click'); $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" }); $("#text_area").val(''); @@ -1093,8 +1107,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $('.btnCursor').addClass('activebtncolor'); - - } @@ -1150,6 +1162,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } var AnnotationCanvas = document.getElementById('canvas'); AnnotationCanvas.removeEventListener('mousemove', $rootScope.OnPaintCanvasMouseMove, false); + $(".line").remove(); $(".arrow").remove(); $(".pin").remove(); @@ -1220,32 +1233,38 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", switch ($rootScope.shapeType) { case "Line": $(".line").remove(); + $rootScope.islineMoved = true; // console.log($rootScope.MouseMoveXAxis - $rootScope.offsetX1); $("#canvasDiv").append("
"); $rootScope.Annotationangle(); break; case "Arrow": $(".arrow").remove(); + $rootScope.isarrowMoved = true; $("#canvasDiv").append("
"); $rootScope.Annotationangle(); break; case "Pin": $(".pin").remove(); + $rootScope.isPinMoved = true; $("#canvasDiv").append("
"); $rootScope.Annotationangle(); break; case "Circle": $(".circle").remove(); + $rootScope.iscircleMoved = true; // console.log($rootScope.offsetX1 + " " + $rootScope.offsetY1 + " " + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + " " + Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)); $("#canvasDiv").append("
"); break; case "Rectangle": $(".rectangle").remove(); + $rootScope.isrectangleMoved = true; // console.log($rootScope.offsetX1 + " " + $rootScope.offsetY1 + " " + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + " " + Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)); $("#canvasDiv").append("
"); break; case "TextArea": $(".textarea").remove(); + $rootScope.istextAreaMoved = true; // console.log($rootScope.offsetX1 + " " + $rootScope.offsetY1 + " " + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + " " + Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)); $("#canvasDiv").append("
"); break; @@ -1270,6 +1289,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", theta = Math.atan(dy / dx) * (180 / Math.PI); } var dottedLineWidth = Math.sqrt(($rootScope.offsetX1 - $rootScope.MouseMoveXAxis) * ($rootScope.offsetX1 - $rootScope.MouseMoveXAxis) + ($rootScope.offsetY1 - $rootScope.MouseMoveYAxis) * ($rootScope.offsetY1 - $rootScope.MouseMoveYAxis)); + switch ($rootScope.shapeType) { case "Line": $('.line').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' }); @@ -1313,6 +1333,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", fillStyle: $rootScope.fontColor, fontStyle: $rootScope.fontWeight + " " + $rootScope.fontStyle, fontSize: $rootScope.fontSizes, + fromCenter: false, fontFamily: $rootScope.fontFamily, align: $rootScope.textAlignmt, strokeWidth: 0, @@ -1336,6 +1357,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", opacity: $rootScope.shapestyleOpacity, strokeStyle: $rootScope.shapestyleborderColor, strokeWidth: $rootScope.shapestyleborderWidth, + fromCenter: false, x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y, width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width, height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height, @@ -1604,6 +1626,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", fontFamily: _modifiedFontFamily, align: _modifiedTextAlign, strokeWidth: 0, + fromCenter: false, text: _modifiedText, x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y, maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width, @@ -1618,6 +1641,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave], dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave], opacity: $rootScope.shapestyleOpacity, + fromCenter: false, strokeStyle: $rootScope.shapestyleborderColor, strokeWidth: $rootScope.shapestyleborderWidth, x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y, -- libgit2 0.21.4