Commit f102c904 authored by Nezael's avatar Nezael
Browse files

Merge branch '165-supprimer-un-objet' into paperboard

parents 90e43a27 2c63ab01
......@@ -21,7 +21,8 @@ ui-sref="project.workshops.overview">{{::_labels.disconnectWorkshopBtn}}
<button ng-click="paperBoardCtrl.circleMode()">Circle</button>
<button ng-click="paperBoardCtrl.squareMode()">Square</button>
<button>Add Post-It</button>
<button>Erase</button>
<button ng-click="paperBoardCtrl.eraseMode()">Erase</button>
<button ng-click="paperBoardCtrl.reset()">Reset</button>
<label for="lineWidth"> Line Width :
<input type="range" name="lineWidth" id="lineWidth" min="1" max="15" value="3" step="1">
</label>
......
......@@ -22,7 +22,7 @@ root.controller('PaperBoardCtrl', ['$scope', '$stateParams', '$http', '$state',
var circle = false;
var cursor = false;
var square = false;
let erase = false;
......@@ -102,6 +102,8 @@ root.controller('PaperBoardCtrl', ['$scope', '$stateParams', '$http', '$state',
circle = false;
square = false;
cursor = false;
pen = true;
erase = false;
}
paperBoardCtrl.circleMode = function ()
......@@ -133,6 +135,16 @@ root.controller('PaperBoardCtrl', ['$scope', '$stateParams', '$http', '$state',
alert("Vous venez de quitter l'atelier");
}
paperBoardCtrl.reset = function(){
ctx.clearRect(0,0,canvas.width,canvas.height);
}
paperBoardCtrl.eraseMode = function(){
erase = true;
pen = false;
}
paperBoardCtrl.getPaperBoardDetails();
document.querySelector('#lineWidth').addEventListener('change', e =>
......@@ -164,6 +176,12 @@ root.controller('PaperBoardCtrl', ['$scope', '$stateParams', '$http', '$state',
}
if(erase)
{
paperBoardCtrl.lineDraw(ctx,mouseX,mouseY,e.clientX - rect.left, e.clientY - rect.top, "white", lineWidth);
mouseX = e.clientX - rect.left;
mouseY = e.clientY - rect.top;
}
}
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment