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
+10 -12

No files matched your search

BIN
View File
Binary file not shown.
-2
View File
@@ -27,8 +27,6 @@
<input type="number" id="rs" /><br>
<label for="np">Number of panels (n<sub>p</sub>): </label>
<input type="number" id="np" min="3" ><br>
<label for="steps">Number of steps: </label>
<input type="number" id="steps" min="10" /><br>
<button id="generate" >Generate!</button>
<p id="len"></p>
<div id="output" style="display: none;"></div>
+1 -1
View File
@@ -12,7 +12,7 @@
"main": "index.js",
"scripts": {
"dev": "vite",
"build": "vite build",
"build": "vite build; tar -cavf build.tar.gz dist",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
+1 -1
View File
@@ -43,7 +43,7 @@ function getValues() {
radius = (parseFloat(rInput.value) * 1);
spillRadius = (parseFloat(rsInput.value) * 1);
numberOfPanels = (parseFloat(npInput.value) * 1);
step = radius / parseInt(stepInput.value);
step = radius / 1000;
paperSize = paperInput.value;
if (isNaN(spillRadius)) {
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[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
if (i != 0 && needsMarkers) {
page.drawLine({
@@ -73,6 +65,14 @@ export async function createPdf(paths, svgSize, scaleFactor, paperSize) {
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 });