From 1423cfe2fe16c59e5c221cfd6bb66261d76398f1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Dec 2016 17:53:13 +0530 Subject: [PATCH] DA > Annotation > When Pin is selected and click on any where on the screen only head of the pin is displays. --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js | 199 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------ 1 file changed, 103 insertions(+), 96 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 1022e65..3225d1f 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -816,108 +816,115 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } $rootScope.PinFn = function (canvasId, PinNumber, offsetX1, offsetY1, x, y, PinArcNumber) { - var radial = $('#canvas').createGradient({ - x1: 50, y1: 50, - x2: 50, y2: 50, - r1: 10, r2: 30, - c1: 'rgba(100, 50, 0,0)', - c2: 'grey' - }); - $(canvasId).drawLine({ - draggable: true, - layer: true, - name: "Pin_" + PinNumber, - groups: ["Pin_" + PinNumber], - dragGroups: ["Pin_" + PinNumber], - strokeStyle: 'black', - strokeWidth: 2, - x1: offsetX1, y1: offsetY1, - x2: x, y2: y, - - click: function (layer) { - - $rootScope.shapeTypePin = "Pin"; - $rootScope.canvasLayerNameCollection = []; - var pinLine_layer = layer.name; - var pinLine_layer_split = pinLine_layer.split("_"); - var pinArcName = "ArcPin_"; - var pinResult = pinArcName.concat(pinLine_layer_split[1]); - - $rootScope.canvasLayerNameCollection.push({ pinName: layer.name, ArcName: pinResult }); - - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - // width: 5, height: 5, - 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(); + + var xAxisPinDiff = offsetX1 - x; + var yAxisPinDiff = offsetY1 - y; + if (xAxisPinDiff != 0 && yAxisPinDiff != 0) + { + var radial = $('#canvas').createGradient({ + x1: 50, y1: 50, + x2: 50, y2: 50, + r1: 10, r2: 30, + c1: 'rgba(100, 50, 0,0)', + c2: 'grey' + }); + $(canvasId).drawLine({ + draggable: true, + layer: true, + name: "Pin_" + PinNumber, + groups: ["Pin_" + PinNumber], + dragGroups: ["Pin_" + PinNumber], + strokeStyle: 'black', + strokeWidth: 2, + x1: offsetX1, y1: offsetY1, + x2: x, y2: y, + + click: function (layer) { + + $rootScope.shapeTypePin = "Pin"; + $rootScope.canvasLayerNameCollection = []; + var pinLine_layer = layer.name; + var pinLine_layer_split = pinLine_layer.split("_"); + var pinArcName = "ArcPin_"; + var pinResult = pinArcName.concat(pinLine_layer_split[1]); + + $rootScope.canvasLayerNameCollection.push({ pinName: layer.name, ArcName: pinResult }); + + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + // width: 5, height: 5, + 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(); - } - }).drawArc({ - draggable: true, - name: "ArcPin_" + PinArcNumber, - // name: "Pin_" + $rootScope.resetPin, - layer: true, - groups: ["Pin_" + PinNumber], - dragGroups: ["Pin_" + PinNumber], - strokeStyle: 'grey', - strokeWidth: 2, - fillStyle: radial, - x: offsetX1, y: offsetY1, - radius: 5, - //handle: { - // type: 'arc', - // fillStyle: '#fff', - // strokeStyle: '#c33', - // strokeWidth: 2, - // radius: 3 - //}, + } + }).drawArc({ + draggable: true, + name: "ArcPin_" + PinArcNumber, + // name: "Pin_" + $rootScope.resetPin, + layer: true, + groups: ["Pin_" + PinNumber], + dragGroups: ["Pin_" + PinNumber], + strokeStyle: 'grey', + strokeWidth: 2, + fillStyle: radial, + x: offsetX1, y: offsetY1, + radius: 5, + //handle: { + // type: 'arc', + // fillStyle: '#fff', + // strokeStyle: '#c33', + // strokeWidth: 2, + // radius: 3 + //}, - add: function (layer) { + add: function (layer) { - $rootScope.PinArcNumber = layer.name; - // $scope.arr = []; + $rootScope.PinArcNumber = layer.name; + // $scope.arr = []; - }, + }, - }).drawLayers(); + }).drawLayers(); + } + $('.btnCursor').trigger('click'); $(".btn-annotation").removeClass("activebtncolor"); $('.btnCursor').addClass('activebtncolor'); -- libgit2 0.21.4