|
|
|
@ -246,8 +246,8 @@ async function PrintImage2(ens: Entity[])
|
|
|
|
|
for (let url of imgUrls)
|
|
|
|
|
{
|
|
|
|
|
let img = new Image();
|
|
|
|
|
img.style.height = "100%";
|
|
|
|
|
// img.style.marginBottom = "2%";
|
|
|
|
|
img.style.maxHeight = "calc(100vh - 100px)";
|
|
|
|
|
img.style.maxWidth = "calc(100vw - 40px)";
|
|
|
|
|
img.src = url;
|
|
|
|
|
div.append(img);
|
|
|
|
|
}
|
|
|
|
@ -316,10 +316,14 @@ export function GetPrintWindow()
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
max-width:100vw;
|
|
|
|
|
max-height:100vh;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@media screen {
|
|
|
|
|
.centerOnPrintedPage {
|
|
|
|
|
height: 100%;
|
|
|
|
|
max-width:100vw;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
win.document.head.append(style);
|
|
|
|
@ -377,12 +381,14 @@ export async function GetImgElement(ens: Entity[], isReset = true)
|
|
|
|
|
let box = GetBox(app.Viewer.Scene, true);
|
|
|
|
|
if (box.isEmpty())
|
|
|
|
|
box.set(new Vector3(), new Vector3(1000 * (this.Width / this.Height), 1000, 1000));
|
|
|
|
|
app.Viewer.CameraControl.ZoomExtentsBox3(box);
|
|
|
|
|
app.Viewer.CameraControl.Zoom(1.01);
|
|
|
|
|
|
|
|
|
|
let size = box.getSize(new Vector3);
|
|
|
|
|
size.multiplyScalar(1450 / size.x);
|
|
|
|
|
app.Viewer.OnSize(size.x * 2, size.y * 2);
|
|
|
|
|
|
|
|
|
|
app.Viewer.CameraControl.ZoomExtentsBox3(box);
|
|
|
|
|
app.Viewer.CameraControl.Zoom(1.01);
|
|
|
|
|
|
|
|
|
|
app.Viewer.Render();
|
|
|
|
|
|
|
|
|
|
let url = app.Viewer.Renderer.domElement.toDataURL("image/jpeg", 1.0);
|
|
|
|
|