JSFiddle - React, Tailwind, and code Playground

HTML

Квадрат, толщина линии 1 пиксель. <br/>
Точка from находится в координатах (10  , 10  ) <br/>
Точка  to  находится в координатах (90.5, 90.5) <br/>
<canvas width="200" height="200"></canvas>

JavaScript

var ctx = document.getElementsByTagName('canvas')[0].getContext('2d');
ctx.strokeStyle = 'red';
ctx.strokeStyle = 'red';
ctx.strokeRect(10, 10, 80.5, 80.5);