|
|
@@ -1,9 +1,9 @@
|
|
|
|
|
|
function Painter(context, dom) {
|
|
|
|
|
|
- let dpr = window.devicePixelRatio;
|
|
|
+ const dpr = window.devicePixelRatio;
|
|
|
|
|
|
- let c = document.createElement('canvas');
|
|
|
+ const c = document.createElement('canvas');
|
|
|
c.width = 16 * dpr;
|
|
|
c.height = 16 * dpr;
|
|
|
c.style.position = 'absolute';
|
|
|
@@ -12,7 +12,7 @@ function Painter(context, dom) {
|
|
|
c.style.pointerEvents = 'none';
|
|
|
c.style.display = 'none';
|
|
|
|
|
|
- let ctx = c.getContext("2d");
|
|
|
+ const ctx = c.getContext("2d");
|
|
|
ctx.lineWidth = 0.5;
|
|
|
ctx.beginPath();
|
|
|
ctx.arc(8 * dpr, 8 * dpr, 7, 0, Math.PI * 2);
|
|
|
@@ -32,9 +32,9 @@ function Painter(context, dom) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- let dx = x2 - x1;
|
|
|
- let dy = y2 - y1;
|
|
|
- let d = Math.sqrt(dx * dx + dy * dy) * 0.015;
|
|
|
+ const dx = x2 - x1;
|
|
|
+ const dy = y2 - y1;
|
|
|
+ const d = Math.sqrt(dx * dx + dy * dy) * 0.015;
|
|
|
|
|
|
if (ccolor !== null) {
|
|
|
|
|
|
@@ -44,28 +44,28 @@ function Painter(context, dom) {
|
|
|
|
|
|
switch (ccolor) {
|
|
|
case 0:
|
|
|
- context.strokeStyle = 'rgba(0, 0, 0, ' + (0.7 - d) + ')';
|
|
|
+ context.strokeStyle = 'rgba(0, 0, 0, ' + (0.9 - d) + ')';
|
|
|
break;
|
|
|
case 1:
|
|
|
- context.strokeStyle = 'rgba(0, 0, 238, ' + (0.7 - d) + ')';
|
|
|
+ context.strokeStyle = 'rgba(0, 0, 238, ' + (0.9 - d) + ')';
|
|
|
break;
|
|
|
case 2:
|
|
|
- context.strokeStyle = 'rgba(0, 208, 0, ' + (0.7 - d) + ')';
|
|
|
+ context.strokeStyle = 'rgba(0, 208, 0, ' + (0.9 - d) + ')';
|
|
|
break;
|
|
|
case 3:
|
|
|
- context.strokeStyle = 'rgba(238, 0, 238, ' + (0.7 - d) + ')';
|
|
|
+ context.strokeStyle = 'rgba(238, 0, 238, ' + (0.9 - d) + ')';
|
|
|
break;
|
|
|
case 4:
|
|
|
- context.strokeStyle = 'rgba(238, 0, 0, ' + (0.7 - d) + ')';
|
|
|
+ context.strokeStyle = 'rgba(238, 0, 0, ' + (0.9 - d) + ')';
|
|
|
break;
|
|
|
case 5:
|
|
|
- context.strokeStyle = 'rgba(119, 60, 0, ' + (0.7 - d) + ')';
|
|
|
+ context.strokeStyle = 'rgba(119, 60, 0, ' + (0.9 - d) + ')';
|
|
|
break;
|
|
|
case 6:
|
|
|
- context.strokeStyle = 'rgba(238, 119, 0, ' + (0.7 - d) + ')';
|
|
|
+ context.strokeStyle = 'rgba(238, 119, 0, ' + (0.9 - d) + ')';
|
|
|
break;
|
|
|
case 7:
|
|
|
- context.strokeStyle = 'rgba(238, 208, 0, ' + (0.7 - d) + ')';
|
|
|
+ context.strokeStyle = 'rgba(238, 208, 0, ' + (0.9 - d) + ')';
|
|
|
break;
|
|
|
case 8:
|
|
|
context.strokeStyle = 'rgba(238, 238, 238, ' + (1 - d) + ')';
|