Commit 7e3fe0130a49ce869cac950865efa4707a68806c

Authored by Amrita Vishnoi
2 parents fee17fee 020abb71

Merge branch 'cinewerase' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js
... ... @@ -620,7 +620,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
620 620 $("#canvasPaint").css("display", "block");
621 621  
622 622 $rootScope.BindCanvasDrawingListners();
623   - // $rootScope.FreeStylePaint();
  623 + $rootScope.FreeStylePaint();
624 624 });
625 625  
626 626 $scope.ReloadListViewImageDiv = function (id) {
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -6858,114 +6858,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6858 6858  
6859 6859  
6860 6860  
6861   - $rootScope.FreeStylePaint = function (e) {
6862   -
6863   - var annotationCanvas = document.getElementById("canvas");
6864   - // document.getElementById("canvasPaint").addEventListener("mouseup", OnPaintBrushCanvasMouseUp);
6865   -
6866   - annotationCanvas.addEventListener('mousedown', $scope.OnPaintCanvasMouseDown, false);
6867   -
6868   - annotationCanvas.addEventListener('mouseup', $scope.OnPaintBrushCanvasMouseUp, false);
6869   - }
6870   - $scope.OnPaintCanvasMouseDown = function (event) {
6871   - $rootScope.isMousedownOnPaintCanvas = true;
6872   - $scope.isStartPointDeleted = false;
6873   - var annotationCanvas = document.getElementById("canvas");
6874   - $scope.startPageX = parseInt(event.clientX - ($("#canvas").offset().left));
6875   - $scope.startPageY = parseInt(event.clientY - ($("#canvas").offset().top));
6876   -
6877   - annotationCanvas.addEventListener('mousemove', $scope.OnPaintCanvasMouseMove, false);
6878   -
6879   -
6880   -
6881   - }
6882   - $scope.OnPaintCanvasMouseMove = function (event) {
6883   -
6884   -
6885   - $rootScope.xPage = parseInt(event.clientX - ($("#canvas").offset().left));
6886   - $rootScope.yPage = parseInt(event.clientY - ($("#canvas").offset().top));
6887   -
6888   - var btneraseBrushSizeValue = $("#btnBrushSize").val();
6889   - $rootScope.eraseshapeSize = parseInt(btneraseBrushSizeValue);
6890   -
6891   - if ($rootScope.isEraseToolSelected == true && $rootScope.isMousedownOnPaintCanvas == true) {
6892   -
6893   - var sktch = $('#canvasPaint').sketch();
6894   - $('#canvasPaint').sketch().actions = [];
6895   - var paintCanvas = document.getElementById("canvasPaint");
6896   - var paintCanvasContext = paintCanvas.getContext('2d');
6897   - if ($scope.isStartPointDeleted == false) {
6898   -
6899   - paintCanvasContext.clearRect($scope.startPageX, $scope.startPageY, $rootScope.eraseshapeSize, $rootScope.eraseshapeSize);
6900   -
6901   - $scope.isStartPointDeleted = true;
6902   - }
6903   -
6904   - paintCanvasContext.clearRect($rootScope.xPage, $rootScope.yPage, $rootScope.eraseshapeSize, $rootScope.eraseshapeSize);
6905   -
6906   -
6907   - }
6908   - }
6909   - $scope.OnPaintBrushCanvasMouseDown = function (event) {
6910   - switch ($rootScope.shapeType) {
6911   -
6912   - case "FreeStylePaint":
6913   -
6914   -
6915   -
6916   - // $('#canvasPaint').sketch();
6917   - // $('#canvasPaint').sketch({ defaultSize: 1 });
6918   - // if ($("#amount-2").val() == '') {
6919   - // //$('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
6920   - // $('#canvasPaint').sketch();
6921   - // }
6922   - // else {
6923   -
6924   - // // var a = $("#amount-2").val();
6925   - //// $scope.shapesize = parseInt(a);
6926   - // // $('#canvasPaint').sketch({ defaultSize: $rootScope.shapeSize });
6927   - // // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
6928   -
6929   - // }
6930   -
6931   -
6932   - break;
6933   -
6934   - }
6935   - }
6936   - $scope.OnPaintBrushCanvasMouseUp = function (event) {
6937   - $rootScope.isMousedownOnPaintCanvas = false;
6938   - $rootScope.isEraseToolSelected = false;
6939   -
6940   - // var canvasElement1 = document.getElementById("canvasPaint");
6941   - // var ctx1 = canvasElement1.getContext("2d");
6942   -
6943   - //switch($rootScope.shapeType)
6944   - //{
6945   -
6946   - // case "FreeStylePaint":
6947   -
6948   -
6949   - // if ($("#amount-2").val() == '')
6950   - // {
6951   - // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
6952   - // }
6953   - // else
6954   - // {
6955   -
6956   - // var a = $("#amount-2").val();
6957   - // $scope.shapesize = parseInt(a);
6958   - // alert(JSON.stringify({ defaultSize: $scope.shapesize }));
6959   - // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
6960   -
6961   - // }
6962   -
6963   -
6964   - // break;
6965   -
6966   - //}
6967   -
6968   - }
  6861 +
  6862 +
6969 6863  
6970 6864  
6971 6865  
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -2100,6 +2100,65 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
2100 2100  
2101 2101 };
2102 2102  
  2103 +
  2104 +
  2105 + $rootScope.FreeStylePaint = function (e) {
  2106 +
  2107 + var annotationCanvas = document.getElementById("canvas");
  2108 + // document.getElementById("canvasPaint").addEventListener("mouseup", OnPaintBrushCanvasMouseUp);
  2109 +
  2110 + annotationCanvas.addEventListener('mousedown', $rootScope.OnPaintBrushCanvasMouseDown, false);
  2111 +
  2112 + annotationCanvas.addEventListener('mouseup', $rootScope.OnPaintBrushCanvasMouseUp, false);
  2113 + }
  2114 +
  2115 +
  2116 +
  2117 +
  2118 + $rootScope.OnPaintBrushCanvasMouseDown = function (event) {
  2119 + $rootScope.isMousedownOnPaintCanvas = true;
  2120 + $rootScope.isStartPointDeleted = false;
  2121 + var annotationCanvas = document.getElementById("canvas");
  2122 + $rootScope.startPageX = parseInt(event.clientX - ($("#canvas").offset().left));
  2123 + $rootScope.startPageY = parseInt(event.clientY - ($("#canvas").offset().top));
  2124 +
  2125 + annotationCanvas.addEventListener('mousemove', $rootScope.OnPaintCanvasMouseMove, false);
  2126 +
  2127 + }
  2128 + $rootScope.OnPaintCanvasMouseMove = function (event) {
  2129 +
  2130 + $rootScope.xPage = parseInt(event.clientX - ($("#canvas").offset().left));
  2131 + $rootScope.yPage = parseInt(event.clientY - ($("#canvas").offset().top));
  2132 +
  2133 + var btneraseBrushSizeValue = $("#btnBrushSize").val();
  2134 + $rootScope.eraseshapeSize = parseInt(btneraseBrushSizeValue);
  2135 +
  2136 + if ($rootScope.isEraseToolSelected == true && $rootScope.isMousedownOnPaintCanvas == true) {
  2137 +
  2138 + var sktch = $('#canvasPaint').sketch();
  2139 + $('#canvasPaint').sketch().actions = [];
  2140 + var paintCanvas = document.getElementById("canvasPaint");
  2141 + var paintCanvasContext = paintCanvas.getContext('2d');
  2142 + if ($rootScope.isStartPointDeleted == false) {
  2143 +
  2144 + paintCanvasContext.clearRect($rootScope.startPageX, $rootScope.startPageY, $rootScope.eraseshapeSize, $rootScope.eraseshapeSize);
  2145 +
  2146 + $rootScope.isStartPointDeleted = true;
  2147 + }
  2148 +
  2149 + paintCanvasContext.clearRect($rootScope.xPage, $rootScope.yPage, $rootScope.eraseshapeSize, $rootScope.eraseshapeSize);
  2150 +
  2151 +
  2152 + }
  2153 + }
  2154 + $rootScope.OnPaintBrushCanvasMouseUp = function (event) {
  2155 + $rootScope.isMousedownOnPaintCanvas = false;
  2156 + $rootScope.isEraseToolSelected = false;
  2157 +
  2158 +
  2159 + }
  2160 +
  2161 +
2103 2162 $rootScope.reloadChildController = function () {
2104 2163  
2105 2164 var len = $rootScope.openModules.length;
... ...