Commit 3d2545d3c901caccbc48b431dcd3ce4f70feb8c7
Merge branch 'sketchipadissue' into QA-IPAD-MAC
Showing
1 changed file
with
43 additions
and
0 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -1716,6 +1716,49 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | @@ -1716,6 +1716,49 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | ||
1716 | var btneraseBrushSizeValue = $("#btnBrushSize").val(); | 1716 | var btneraseBrushSizeValue = $("#btnBrushSize").val(); |
1717 | $('#canvasPaint').sketch(); | 1717 | $('#canvasPaint').sketch(); |
1718 | $rootScope.eraseshapeSize = parseInt(btneraseBrushSizeValue); | 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 | $("#annotationpainteraser").attr("data-size", $rootScope.eraseshapeSize); | 1762 | $("#annotationpainteraser").attr("data-size", $rootScope.eraseshapeSize); |
1720 | return $.sketch.tools.eraser = { | 1763 | return $.sketch.tools.eraser = { |
1721 | onEvent: function (e) { | 1764 | onEvent: function (e) { |