found more bugs

This commit is contained in:
chopster44 committed 2026-10-03 20:27:04 +01:00
1 parent 0b776a631c
commit da7e9f6a95
5 files changed
+11 -13

No files matched your search

BIN
View File
Binary file not shown.
+1 -3
View File
@@ -27,9 +27,7 @@
<input type="number" id="rs" /><br> <input type="number" id="rs" /><br>
<label for="np">Number of panels (n<sub>p</sub>): </label> <label for="np">Number of panels (n<sub>p</sub>): </label>
<input type="number" id="np" min="3" ><br> <input type="number" id="np" min="3" ><br>
<label for="steps">Number of steps: </label> <button id="generate" >Generate!</button>
<input type="number" id="steps" min="10" /><br>
<button id="generate">Generate!</button>
<p id="len"></p> <p id="len"></p>
<div id="output" style="display: none;"></div> <div id="output" style="display: none;"></div>
<iframe id="pdf" style="width:100%;height:1000px"></iframe> <iframe id="pdf" style="width:100%;height:1000px"></iframe>
+1 -1
View File
@@ -12,7 +12,7 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build; tar -cavf build.tar.gz dist",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"dependencies": { "dependencies": {
+1 -1
View File
@@ -43,7 +43,7 @@ function getValues() {
radius = (parseFloat(rInput.value) * 1); radius = (parseFloat(rInput.value) * 1);
spillRadius = (parseFloat(rsInput.value) * 1); spillRadius = (parseFloat(rsInput.value) * 1);
numberOfPanels = (parseFloat(npInput.value) * 1); numberOfPanels = (parseFloat(npInput.value) * 1);
step = radius / parseInt(stepInput.value); step = radius / 1000;
paperSize = paperInput.value; paperSize = paperInput.value;
if (isNaN(spillRadius)) { if (isNaN(spillRadius)) {
spillRadius = (0.05 * radius); spillRadius = (0.05 * radius);
+8 -8
View File
@@ -50,14 +50,6 @@ export async function createPdf(paths, svgSize, scaleFactor, paperSize) {
page.drawSvgPath(paths[0], svgSettings); page.drawSvgPath(paths[0], svgSettings);
page.drawSvgPath(paths[1], svgSettings); page.drawSvgPath(paths[1], svgSettings);
// margins
page.drawSvgPath(`M ${margins.x/2},${margins.y/2} ${margins.x/2},${height-margins.y/2} ${width-margins.x/2},${height-margins.y/2} ${width-margins.x/2},${margins.y/2} ${margins.x/2},${margins.y/2} Z`, {
x:0,
y:height,
borderColor: rgb(1,1,1),
borderWidth: margins.x
});
// draw top alignmnet marker // draw top alignmnet marker
if (i != 0 && needsMarkers) { if (i != 0 && needsMarkers) {
page.drawLine({ page.drawLine({
@@ -73,6 +65,14 @@ export async function createPdf(paths, svgSize, scaleFactor, paperSize) {
end: { x: width, y: 2 * margins.y }, end: { x: width, y: 2 * margins.y },
}); });
} }
// margins
page.drawSvgPath(`M ${margins.x/2},${margins.y/2} ${margins.x/2},${height-margins.y/2} ${width-margins.x/2},${height-margins.y/2} ${width-margins.x/2},${margins.y/2} ${margins.x/2},${margins.y/2} Z`, {
x:0,
y:height,
borderColor: rgb(1,1,1),
borderWidth: margins.x
});
} }
const pdfDataUri = await pdfDocument.saveAsBase64({ dataUri: true }); const pdfDataUri = await pdfDocument.saveAsBase64({ dataUri: true });