|
|
@@ -203,10 +203,13 @@ export class FrameInspectorDialogComponent implements AfterViewInit {
|
|
|
|
|
|
const img = new Image();
|
|
|
img.onload = () => {
|
|
|
- const maxW = Math.min(560, img.naturalWidth);
|
|
|
+ const containerW = canvas.parentElement?.clientWidth ?? 560;
|
|
|
+ const maxW = Math.min(containerW, img.naturalWidth);
|
|
|
const scale = maxW / img.naturalWidth;
|
|
|
canvas.width = img.naturalWidth * scale;
|
|
|
canvas.height = img.naturalHeight * scale;
|
|
|
+ canvas.style.width = '100%';
|
|
|
+ canvas.style.height = 'auto';
|
|
|
const ctx = canvas.getContext('2d')!;
|
|
|
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
|
|
|
|