fix(settings/touchScreen/tapTap): floor crosshair position
This commit is contained in:
@@ -360,19 +360,22 @@ onRender((ctx) => {
|
||||
}
|
||||
|
||||
// draw crosshair
|
||||
const cx = Math.floor(x);
|
||||
const cy = Math.floor(y);
|
||||
|
||||
ctx.fillStyle = "#494949";
|
||||
ctx.fillRect(x, 0, 1, LOGICAL_HEIGHT);
|
||||
ctx.fillRect(0, y, LOGICAL_WIDTH, 1);
|
||||
ctx.fillRect(cx, 0, 1, LOGICAL_HEIGHT);
|
||||
ctx.fillRect(0, cy, LOGICAL_WIDTH, 1);
|
||||
|
||||
ctx.fillStyle = "#fb0000";
|
||||
ctx.fillRect(x - 4, y - 4, 9, 9);
|
||||
ctx.fillRect(cx - 4, cy - 4, 9, 9);
|
||||
|
||||
ctx.fillStyle = "#fbfafa";
|
||||
ctx.fillRect(x - 2, y - 2, 5, 5);
|
||||
ctx.fillRect(cx - 2, cy - 2, 5, 5);
|
||||
|
||||
ctx.fillStyle = "#fb0000";
|
||||
ctx.fillRect(x, y - 1, 1, 3);
|
||||
ctx.fillRect(x - 1, y, 3, 1);
|
||||
ctx.fillRect(cx, cy - 1, 1, 3);
|
||||
ctx.fillRect(cx - 1, cy, 3, 1);
|
||||
}, 0);
|
||||
|
||||
onRender((ctx) => {
|
||||
|
||||
Reference in New Issue
Block a user