added existing watchareas to canvas

This commit is contained in:
BroodjeAap 2020-07-12 18:43:59 +00:00
parent 7206c087d5
commit a6864c1928
2 changed files with 12 additions and 0 deletions

View file

@ -76,6 +76,7 @@ function draw(){
ctx.clearRect(0, 0, canvas.width, canvas.height);
drawImage();
watchArea.draw(ctx);
watchAreas.forEach(watchArea => watchArea.draw(ctx));
}
function drawImage(){

View file

@ -64,4 +64,15 @@
</tr>
</template>
<script>
{{range $watchArea := .WatchAreas}}
watchAreas.push(new WatchArea(
'{{ $watchArea.Name }}',
{{ $watchArea.Area.Min.X }}, {{ $watchArea.Area.Min.Y }},
{{ $watchArea.Area.Max.X }}, {{ $watchArea.Area.Max.Y }},
{{ $watchArea.Color.R }}, {{ $watchArea.Color.G }}, {{ $watchArea.Color.B }}
));
{{end}}
</script>
{{end}}