found more bugs
This commit is contained in:
5 files changed
+11
-13
No files matched your search
Binary file not shown.
+1
-3
@@ -27,9 +27,7 @@
|
||||
<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>
|
||||
<button id="generate" >Generate!</button>
|
||||
<p id="len"></p>
|
||||
<div id="output" style="display: none;"></div>
|
||||
<iframe id="pdf" style="width:100%;height:1000px"></iframe>
|
||||
|
||||
+1
-1
@@ -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
@@ -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
@@ -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 });
|
||||
|
||||
Reference in new issue
Block a user