Skip to content

Commit

Permalink
style: fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jbms committed Jul 23, 2024
1 parent c9081c0 commit 90cf144
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
.parcel-cache
dist
/lib
/docs/_build/
/.ruff_cache
5 changes: 4 additions & 1 deletion src/ui/viewer_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ export class ViewerSettingsPanel extends SidePanel {
);
addCheckbox("Wire frame rendering", viewer.wireFrame);
addCheckbox("Enable prefetching", viewer.chunkQueueManager.enablePrefetch);
addCheckbox("Enable adaptive downsampling", viewer.enableAdaptiveDownsampling);
addCheckbox(
"Enable adaptive downsampling",
viewer.enableAdaptiveDownsampling,
);

const addColor = (label: string, value: WatchableValueInterface<vec3>) => {
const labelElement = document.createElement("label");
Expand Down
10 changes: 5 additions & 5 deletions src/util/framerate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ describe("FrameRateCounter", () => {
100,
15,
);

// Without any frames, the downsampling rate is 4
expect(frameRateCounter.calculateDownsamplingRate()).toEqual(4);

// 80ms / 100ms < 1, so no downsampling
for (let i = 0; i < 10; i++) {
frameRateCounter.addFrame(i * 80);
Expand All @@ -86,19 +86,19 @@ describe("FrameRateCounter", () => {
frameRateCounter.addFrame(i * 400);
}
expect(frameRateCounter.calculateDownsamplingRate()).toEqual(4);

// Better fps now, but the high rate persists for a while
for (let i = 0; i < 10; i++) {
frameRateCounter.addFrame(i * 50);
}
expect(frameRateCounter.calculateDownsamplingRate()).toEqual(4);

// The downsampling rate will eventually drop
for (let i = 0; i < 10; i++) {
frameRateCounter.addFrame(i * 50);
}
expect(frameRateCounter.calculateDownsamplingRate()).toEqual(1);

// If the frame rate is very bad, still caps at 8
frameRateCounter.resetForNewFrameSet();
expect(frameRateCounter.calculateDownsamplingRate()).toEqual(1);
Expand Down

0 comments on commit 90cf144

Please sign in to comment.