on functions
	const functions = s2x_x2s_s2y_y2s_from_UI();
	const s2x = functions[0];
	const x2s = functions[1];
	const s2y = functions[2];
	const y2s = functions[3];

	// the grid
	const scale = Number(document.getElementById("scale").value);
	const step = scale < 16 ? 1 : floor(scale / 8);
	const stepped = function(x) {return floor(x / step) * step;}

	context.beginPath();
	context.setLineDash([2, 3]);
	if(document.getElementById("scale_1").checked) {
		// horizontal
		for(var j = stepped(s2x(0)); j <= st