found more bugs
This commit is contained in:
5 files changed
+10
-12
No files matched your search
Binary file not shown.
@@ -27,8 +27,6 @@
|
|||||||
<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>
|
|
||||||
<input type="number" id="steps" min="10" /><br>
|
|
||||||
<button id="generate" >Generate!</button>
|
<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>
|
||||||
|
|||||||
+1
-1
@@ -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
@@ -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
@@ -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 });
|
||||||
|
|||||||
Reference in new issue
Block a user