Commit 987145f1 authored by Raitis Ralfs's avatar Raitis Ralfs
Browse files

Draw X inside circle

parent f359332a
......@@ -89,4 +89,3 @@ function update(){
}
requestAnimationFrame(update);
\ No newline at end of file
......@@ -47,6 +47,7 @@ document.getElementById("otraisUzdevums").addEventListener("click", function(e){
function tresaisUzdevums() {
let canvasElement = document.getElementById("tresaisUzdevums");
let ctx = canvasElement.getContext("2d");
let x = canvasElement.width / 2;
let y = canvasElement.height / 2;
ctx.beginPath();
......@@ -54,6 +55,15 @@ function tresaisUzdevums() {
ctx.strokeStyle="red";
ctx.lineWidth=3;
ctx.stroke();
ctx.beginPath();
ctx.moveTo(x - 20, y - 20);
ctx.lineTo(x + 20, y + 20);
ctx.moveTo(x + 20, y - 20);
ctx.lineTo(x - 20, y + 20);
ctx.stroke();
}
$('.ceturtaisUzdevums').click(function(){
......
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