Commit 6296460275f652dcf3a6ccddac3569bd33af5a03

Authored by Mukul Rajput
1 parent 2c208565

this is solution for the bug erase with ipad

400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -1716,6 +1716,49 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
1716 1716 var btneraseBrushSizeValue = $("#btnBrushSize").val();
1717 1717 $('#canvasPaint').sketch();
1718 1718 $rootScope.eraseshapeSize = parseInt(btneraseBrushSizeValue);
  1719 + $.sketch.tools.marker = {
  1720 + onEvent: function (e) {
  1721 + switch (e.type) {
  1722 + case 'mousedown':
  1723 + case 'touchstart':
  1724 + if (this.painting) {
  1725 + this.stopPainting();
  1726 + }
  1727 + this.startPainting();
  1728 + break;
  1729 + case 'mouseup':
  1730 + case 'mouseout':
  1731 + case 'mouseleave':
  1732 + case 'touchend':
  1733 + case 'touchcancel':
  1734 + this.stopPainting();
  1735 + }
  1736 + if (this.painting) {
  1737 + this.action.events.push({
  1738 + x: e.pageX - this.canvas.offset().left,
  1739 + y: e.pageY - this.canvas.offset().top,
  1740 + event: e.type
  1741 + });
  1742 + return this.redraw();
  1743 + }
  1744 + },
  1745 + draw: function (action) {
  1746 + var event, previous, _i, _len, _ref;
  1747 + this.context.lineJoin = "round";
  1748 + this.context.lineCap = "round";
  1749 + this.context.beginPath();
  1750 + this.context.moveTo(action.events[0].x, action.events[0].y);
  1751 + _ref = action.events;
  1752 + for (_i = 0, _len = _ref.length; _i < _len; _i++) {
  1753 + event = _ref[_i];
  1754 + this.context.lineTo(event.x, event.y);
  1755 + previous = event;
  1756 + }
  1757 + this.context.strokeStyle = action.color;
  1758 + this.context.lineWidth = action.size;
  1759 + return this.context.stroke();
  1760 + }
  1761 + };
1719 1762 $("#annotationpainteraser").attr("data-size", $rootScope.eraseshapeSize);
1720 1763 return $.sketch.tools.eraser = {
1721 1764 onEvent: function (e) {
... ...