From 65e74a8815aad79373b6a9869463bdaac83b3bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20M=C3=BCller?= Date: Tue, 8 Oct 2024 01:53:29 +0200 Subject: [PATCH] Make focus test waste less space --- examples/Schnittdaten-Skripte/Schnitttest.ls | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/Schnittdaten-Skripte/Schnitttest.ls b/examples/Schnittdaten-Skripte/Schnitttest.ls index b876022..e8b41db 100644 --- a/examples/Schnittdaten-Skripte/Schnitttest.ls +++ b/examples/Schnittdaten-Skripte/Schnitttest.ls @@ -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);