From b959cf5806c77b1428f047283a02274de4c629fd Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Wed, 5 Apr 2023 11:45:30 +0200 Subject: [PATCH] proper a4 sizing --- envelope.asy | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/envelope.asy b/envelope.asy index e1fc747..3ec2629 100644 --- a/envelope.asy +++ b/envelope.asy @@ -15,6 +15,7 @@ string envfmt = "C6"; // debugging tool bool with_labels = true; +bool force_a4 = true; // It is unpractical to try emulating second quadrant. We will work in the @@ -22,9 +23,6 @@ bool with_labels = true; // the whole page). Therefore, the bottom edge of the page is at y=(210-297) int pgbot = pgw - pgh; -//Force A4 size -//draw((0,pgbot) -- (0, sqsz) -- (sqsz, sqsz) -- (sqsz, pgbot) -- cycle, invisible); - // gimme a square? if (with_labels) draw(box((0,0), (sqsz, sqsz)), p=red); @@ -116,3 +114,10 @@ draw(cb2 -- cl2); draw(cl1 -- (0, sqsz) -- ct2); draw(ct1 -- cr1); draw(cr2 -- (sqsz, 0) -- cb1); + +//Force A4 output size +path a4_outline = (0,pgbot) -- (0, sqsz) -- (sqsz, sqsz) -- (sqsz, pgbot) -- cycle; +if (force_a4) { + draw(a4_outline, invisible); + clip(a4_outline); +}