Commit 1423cfe2fe16c59e5c221cfd6bb66261d76398f1
1 parent
047c53c9
DA > Annotation > When Pin is selected and click on any where on the screen only…
… head of the pin is displays.
Showing
1 changed file
with
103 additions
and
96 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -816,108 +816,115 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", |
816 | 816 | } |
817 | 817 | |
818 | 818 | $rootScope.PinFn = function (canvasId, PinNumber, offsetX1, offsetY1, x, y, PinArcNumber) { |
819 | - var radial = $('#canvas').createGradient({ | |
820 | - x1: 50, y1: 50, | |
821 | - x2: 50, y2: 50, | |
822 | - r1: 10, r2: 30, | |
823 | - c1: 'rgba(100, 50, 0,0)', | |
824 | - c2: 'grey' | |
825 | - }); | |
826 | - $(canvasId).drawLine({ | |
827 | - draggable: true, | |
828 | - layer: true, | |
829 | - name: "Pin_" + PinNumber, | |
830 | - groups: ["Pin_" + PinNumber], | |
831 | - dragGroups: ["Pin_" + PinNumber], | |
832 | - strokeStyle: 'black', | |
833 | - strokeWidth: 2, | |
834 | - x1: offsetX1, y1: offsetY1, | |
835 | - x2: x, y2: y, | |
836 | - | |
837 | - click: function (layer) { | |
838 | - | |
839 | - $rootScope.shapeTypePin = "Pin"; | |
840 | - $rootScope.canvasLayerNameCollection = []; | |
841 | - var pinLine_layer = layer.name; | |
842 | - var pinLine_layer_split = pinLine_layer.split("_"); | |
843 | - var pinArcName = "ArcPin_"; | |
844 | - var pinResult = pinArcName.concat(pinLine_layer_split[1]); | |
845 | - | |
846 | - $rootScope.canvasLayerNameCollection.push({ pinName: layer.name, ArcName: pinResult }); | |
847 | - | |
848 | - $(canvasId).setLayer(layer.name, { | |
849 | - handle: { | |
850 | - type: 'arc', | |
851 | - fillStyle: '#fff', | |
852 | - strokeStyle: '#c33', | |
853 | - strokeWidth: 2, | |
854 | - // width: 5, height: 5, | |
855 | - radius: 3 | |
856 | - } | |
857 | - }).drawLayers(); | |
858 | - | |
859 | - | |
860 | - }, | |
861 | - mouseout: function (layer) { | |
862 | - | |
863 | - $rootScope.canvasLayerNameCollection = []; | |
864 | - $(canvasId).setLayer(layer.name, { | |
865 | - handle: { | |
866 | - type: 'arc', | |
867 | - fillStyle: '#fff', | |
868 | - strokeStyle: '#c33', | |
869 | - strokeWidth: 0, | |
870 | - // width: 0, height: 0, | |
871 | - radius: 0 | |
872 | - } | |
873 | - | |
874 | - }).drawLayers(); | |
875 | - | |
876 | - }, | |
877 | - mouseover: function (layer) { | |
878 | - | |
879 | - | |
880 | - $(canvasId).setLayer(layer.name, { | |
881 | - handle: { | |
882 | - type: 'arc', | |
883 | - fillStyle: '#fff', | |
884 | - strokeStyle: '#c33', | |
885 | - strokeWidth: 2, | |
886 | - // width: 5, height: 5, | |
887 | - radius: 3 | |
888 | - } | |
889 | - }).drawLayers(); | |
819 | + | |
820 | + var xAxisPinDiff = offsetX1 - x; | |
821 | + var yAxisPinDiff = offsetY1 - y; | |
822 | + if (xAxisPinDiff != 0 && yAxisPinDiff != 0) | |
823 | + { | |
824 | + var radial = $('#canvas').createGradient({ | |
825 | + x1: 50, y1: 50, | |
826 | + x2: 50, y2: 50, | |
827 | + r1: 10, r2: 30, | |
828 | + c1: 'rgba(100, 50, 0,0)', | |
829 | + c2: 'grey' | |
830 | + }); | |
831 | + $(canvasId).drawLine({ | |
832 | + draggable: true, | |
833 | + layer: true, | |
834 | + name: "Pin_" + PinNumber, | |
835 | + groups: ["Pin_" + PinNumber], | |
836 | + dragGroups: ["Pin_" + PinNumber], | |
837 | + strokeStyle: 'black', | |
838 | + strokeWidth: 2, | |
839 | + x1: offsetX1, y1: offsetY1, | |
840 | + x2: x, y2: y, | |
841 | + | |
842 | + click: function (layer) { | |
843 | + | |
844 | + $rootScope.shapeTypePin = "Pin"; | |
845 | + $rootScope.canvasLayerNameCollection = []; | |
846 | + var pinLine_layer = layer.name; | |
847 | + var pinLine_layer_split = pinLine_layer.split("_"); | |
848 | + var pinArcName = "ArcPin_"; | |
849 | + var pinResult = pinArcName.concat(pinLine_layer_split[1]); | |
850 | + | |
851 | + $rootScope.canvasLayerNameCollection.push({ pinName: layer.name, ArcName: pinResult }); | |
852 | + | |
853 | + $(canvasId).setLayer(layer.name, { | |
854 | + handle: { | |
855 | + type: 'arc', | |
856 | + fillStyle: '#fff', | |
857 | + strokeStyle: '#c33', | |
858 | + strokeWidth: 2, | |
859 | + // width: 5, height: 5, | |
860 | + radius: 3 | |
861 | + } | |
862 | + }).drawLayers(); | |
863 | + | |
864 | + | |
865 | + }, | |
866 | + mouseout: function (layer) { | |
867 | + | |
868 | + $rootScope.canvasLayerNameCollection = []; | |
869 | + $(canvasId).setLayer(layer.name, { | |
870 | + handle: { | |
871 | + type: 'arc', | |
872 | + fillStyle: '#fff', | |
873 | + strokeStyle: '#c33', | |
874 | + strokeWidth: 0, | |
875 | + // width: 0, height: 0, | |
876 | + radius: 0 | |
877 | + } | |
878 | + | |
879 | + }).drawLayers(); | |
880 | + | |
881 | + }, | |
882 | + mouseover: function (layer) { | |
883 | + | |
884 | + | |
885 | + $(canvasId).setLayer(layer.name, { | |
886 | + handle: { | |
887 | + type: 'arc', | |
888 | + fillStyle: '#fff', | |
889 | + strokeStyle: '#c33', | |
890 | + strokeWidth: 2, | |
891 | + // width: 5, height: 5, | |
892 | + radius: 3 | |
893 | + } | |
894 | + }).drawLayers(); | |
890 | 895 | |
891 | - } | |
892 | - }).drawArc({ | |
893 | - draggable: true, | |
894 | - name: "ArcPin_" + PinArcNumber, | |
895 | - // name: "Pin_" + $rootScope.resetPin, | |
896 | - layer: true, | |
897 | - groups: ["Pin_" + PinNumber], | |
898 | - dragGroups: ["Pin_" + PinNumber], | |
899 | - strokeStyle: 'grey', | |
900 | - strokeWidth: 2, | |
901 | - fillStyle: radial, | |
902 | - x: offsetX1, y: offsetY1, | |
903 | - radius: 5, | |
904 | - //handle: { | |
905 | - // type: 'arc', | |
906 | - // fillStyle: '#fff', | |
907 | - // strokeStyle: '#c33', | |
908 | - // strokeWidth: 2, | |
909 | - // radius: 3 | |
910 | - //}, | |
896 | + } | |
897 | + }).drawArc({ | |
898 | + draggable: true, | |
899 | + name: "ArcPin_" + PinArcNumber, | |
900 | + // name: "Pin_" + $rootScope.resetPin, | |
901 | + layer: true, | |
902 | + groups: ["Pin_" + PinNumber], | |
903 | + dragGroups: ["Pin_" + PinNumber], | |
904 | + strokeStyle: 'grey', | |
905 | + strokeWidth: 2, | |
906 | + fillStyle: radial, | |
907 | + x: offsetX1, y: offsetY1, | |
908 | + radius: 5, | |
909 | + //handle: { | |
910 | + // type: 'arc', | |
911 | + // fillStyle: '#fff', | |
912 | + // strokeStyle: '#c33', | |
913 | + // strokeWidth: 2, | |
914 | + // radius: 3 | |
915 | + //}, | |
911 | 916 | |
912 | - add: function (layer) { | |
917 | + add: function (layer) { | |
913 | 918 | |
914 | - $rootScope.PinArcNumber = layer.name; | |
915 | - // $scope.arr = []; | |
919 | + $rootScope.PinArcNumber = layer.name; | |
920 | + // $scope.arr = []; | |
916 | 921 | |
917 | 922 | |
918 | - }, | |
923 | + }, | |
919 | 924 | |
920 | - }).drawLayers(); | |
925 | + }).drawLayers(); | |
926 | + } | |
927 | + | |
921 | 928 | $('.btnCursor').trigger('click'); |
922 | 929 | $(".btn-annotation").removeClass("activebtncolor"); |
923 | 930 | $('.btnCursor').addClass('activebtncolor'); | ... | ... |