Make focus test waste less space

This commit is contained in:
Fabian Müller 2024-10-08 01:53:29 +02:00
parent e4512627b7
commit 65e74a8815

View File

@ -171,7 +171,7 @@ function focusTest(x, y) {
move(x, y);
// some definitions
var maxLineHeight = 10;
var maxLineHeight = 6;
var smallLineHeight = maxLineHeight * 0.75;
var spacing = 1.5;
var minFocus = -10;
@ -185,10 +185,6 @@ function focusTest(x, y) {
samples.push(focus);
}
// first, let's draw the word "focus" above the soon-to-be focus test
segment7write(x, y, fontWidth, "FOCUS");
y += fontWidth * 3;
// next up: the actual focus test
for (var i = 0; i < samples.length; ++i)
{
@ -207,7 +203,7 @@ function focusTest(x, y) {
line(xCoord, y + maxLineHeight - currentLineHeight);
}
// focus on the material surface
// set focus back to the material surface
set("focus", 0);
// draw minimum and maximum values on the edges as well as a zero marker
@ -231,6 +227,10 @@ function focusTest(x, y) {
move(roofX, y + yTextOffset);
line(roofX + sign * fontWidth * 1.5, y + yTextOffset + fontWidth * 1.5);
}
// draw the word "focus" left-aligned below the soon-to-be focus test
y += fontWidth * 3 + spacing * 1 + maxLineHeight;
segment7write(x, y, fontWidth, "FOCUS");
}
@ -253,7 +253,7 @@ function cutSpeedTest(contentXOffset, contentYOffset, powersToTest, speedsToTest
// this text will be aligned centrally above the X axis
var firstColumnOffset = 3 * fontWidth * 1.5;
var powersText = "power";
segment7write(contentXOffset + firstColumnOffset + powersToTest.length / 2 * (squareSize + squareSpacing - 0) - (powersText.length / 2) * fontWidth * 1.5, 15, fontWidth, powersText);
segment7write(contentXOffset + firstColumnOffset + powersToTest.length / 2 * (squareSize + squareSpacing - 0) - (powersText.length / 2) * fontWidth * 1.5, contentYOffset - fontWidth * 3, fontWidth, powersText);
// write column texts in the first ever row
for (var i = 0; i < powersToTest.length; ++i) {
@ -339,6 +339,6 @@ if (!promptUserForMaxMinIntervals) {
}
}
yOffset += 20;
yOffset += 12;
cutSpeedTest(xOffset, yOffset, powersToTest, speedsToTest);