Skip to content

Commit

Permalink
feat: fine tune num pixel limit on screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
seankmartin committed Dec 16, 2024
1 parent e66bfde commit 3713da8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util/screenshot_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
} from "#src/util/viewer_resolution_stats.js";
import type { Viewer } from "#src/viewer.js";

export const MAX_RENDER_AREA_PIXELS = 5041 * 5041;
export const MAX_RENDER_AREA_PIXELS = 5100 * 5100;
const SCREENSHOT_TIMEOUT = 3000;

export interface ScreenshotLoadStatistics extends ScreenshotChunkStatistics {
Expand Down Expand Up @@ -354,6 +354,7 @@ export class ScreenshotManager extends RefCounted {
const numPixels =
(currentCanvasSize.width * currentCanvasSize.height) /
(oldScale * oldScale);
console.log(Math.sqrt(numPixels * intendedScale * intendedScale));
if (numPixels * intendedScale * intendedScale > MAX_RENDER_AREA_PIXELS) {
intendedScale = Math.sqrt(MAX_RENDER_AREA_PIXELS / numPixels);
}
Expand Down

0 comments on commit 3713da8

Please sign in to comment.