Feat/adaptive lod threshold (#5249)

* feat: use a physical min font size as the LOD threshold instead of an abritrary zoom level that is different on different screens

* feat: min 1px font size, max 24ox font size

* refactor: settings text

* refactor: settings text

* refactor: version

* fix: default font size from 10 to 8

* feat: cache the threshold and move it's calculation out of the render loop

* refactor: comments

* refactor: removed package-lock

* refactor: improve how we manage deprecated settings, and removed any types

* refactor: how the migration settings formula works so we get prev settings closer to the new font size setting

* test: add in zoom and settings test for LOD

* refactor: tests to use best practices

* Update test expectations [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Simula_r
2025-09-03 12:38:44 -07:00
committed by snomiao
parent 8c32706708
commit 9bed2cc1e6
9 changed files with 321 additions and 15 deletions

View File

@@ -460,11 +460,12 @@ const zSettings = z.object({
'Comfy.Workflow.AutoSaveDelay': z.number(),
'Comfy.Workflow.AutoSave': z.enum(['off', 'after delay']),
'Comfy.RerouteBeta': z.boolean(),
'LiteGraph.Canvas.LowQualityRenderingZoomThreshold': z.number(),
'LiteGraph.Canvas.MinFontSizeForLOD': z.number(),
'Comfy.Canvas.SelectionToolbox': z.boolean(),
'LiteGraph.Node.TooltipDelay': z.number(),
'LiteGraph.ContextMenu.Scaling': z.boolean(),
'LiteGraph.Reroute.SplineOffset': z.number(),
'LiteGraph.Canvas.LowQualityRenderingZoomThreshold': z.number(),
'Comfy.Toast.DisableReconnectingToast': z.boolean(),
'Comfy.Workflow.Persist': z.boolean(),
'Comfy.TutorialCompleted': z.boolean(),