feat: New style for HippieCrosshair
This commit is contained in:
parent
4f029a1a73
commit
a56b8f8ca7
2 changed files with 26 additions and 1 deletions
|
|
@ -208,6 +208,9 @@ class HippieCrosshair {
|
|||
case 'dot':
|
||||
this.dot();
|
||||
break;
|
||||
case 'level':
|
||||
this.level();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -244,7 +247,7 @@ class HippieCrosshair {
|
|||
// Inner dot
|
||||
this.ctx.fillStyle = this.color;
|
||||
this.ctx.beginPath();
|
||||
this.ctx.arc(this.mouseX, this.mouseY, this.thickness * 1.5, 0, Math.PI * 2);
|
||||
this.ctx.arc(this.mouseX, this.mouseY, this.thickness, 0, Math.PI * 2);
|
||||
this.ctx.fill();
|
||||
}
|
||||
|
||||
|
|
@ -255,6 +258,27 @@ class HippieCrosshair {
|
|||
this.ctx.fill();
|
||||
}
|
||||
|
||||
level() {
|
||||
this.ctx.beginPath();
|
||||
this.ctx.moveTo(this.mouseX - this.size * 2, this.mouseY);
|
||||
this.ctx.lineTo(this.mouseX - this.gapSize * 2, this.mouseY);
|
||||
this.ctx.stroke();
|
||||
|
||||
this.ctx.beginPath();
|
||||
this.ctx.arc(this.mouseX, this.mouseY, this.size, 0, Math.PI);
|
||||
this.ctx.stroke();
|
||||
|
||||
this.ctx.beginPath();
|
||||
this.ctx.moveTo(this.mouseX + this.gapSize * 2, this.mouseY);
|
||||
this.ctx.lineTo(this.mouseX + this.size * 2, this.mouseY);
|
||||
this.ctx.stroke();
|
||||
|
||||
this.ctx.fillStyle = this.color;
|
||||
this.ctx.beginPath();
|
||||
this.ctx.arc(this.mouseX, this.mouseY, this.thickness, 0, Math.PI * 2);
|
||||
this.ctx.fill();
|
||||
}
|
||||
|
||||
setCrosshairStyle(style) {
|
||||
this.style = style;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ tags:
|
|||
<button onclick="changeCrosshairStyle('cross')"><i class="bi bi-plus-lg"></i></button>
|
||||
<button onclick="changeCrosshairStyle('circle')"><i class="bi bi-circle"></i></button>
|
||||
<button onclick="changeCrosshairStyle('dot')"><i class="bi bi-dot"></i></button>
|
||||
<button onclick="changeCrosshairStyle('level')"><i class="bi bi-dash-circle"></i></button>
|
||||
</nav>
|
||||
<nav>
|
||||
<span>Connector</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue