Better docs

This commit is contained in:
leduc 2025-04-27 15:55:38 +02:00
parent 356755c486
commit cd93efa04f
12 changed files with 560 additions and 29 deletions

View file

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Simu Rack</title>
<title>LJnano</title>
<meta charset="utf-8" />
<meta name="apple-mobile-web-app-title" content="LJ">
<meta name="apple-mobile-web-app-capable" content="yes">
@ -452,7 +452,7 @@
var ctx = canvas.getContext("2d");
var lastpoint = { x: 0, y: 0, color: 0};
ctx.clearRect(0,0,400,400);
var zoom = 0.5;
var zoom = 0.1333;
//ctx.save
// Draws every segment received, except black colored target ones
@ -461,18 +461,19 @@
{
ctx.clearRect(0,0,400,400);
lastpoint = {
x:pl2[0],
y:pl2[1],
x:pl2[0]+1500,
y:pl2[1]+1500,
color:pl2[2]
}
for (var i = 0; i <= pl2.length; i+=3)
for (var i = 0; i <= pl2.length-1; i+=3)
{
point = {
x:pl2[i],
y:pl2[i+1],
x:pl2[i]+1500,
y:pl2[i+1]+1500,
color:pl2[i+2]
}
// console.log(lastpoint,point)
//console.log(point)
//console.log(point.x * zoom, point.y * zoom);
// if the target is black, skip drawing
if( point.color != 0){
ctx.beginPath()
@ -480,6 +481,7 @@
//ctx.shadowOffsetY = 0;
ctx.shadowBlur = 5;
ctx.shadowColor = 'rgba(255, 255, 255, 1)';
///ctx.shadowColor = 'rgba(255, 255, 255, 1)';
ctx.lineWidth = 2;
ctx.strokeStyle = "#"+(point.color + Math.pow(16, 6)).toString(16).slice(-6);
ctx.moveTo(lastpoint.x * zoom, lastpoint.y * zoom);