This commit is contained in:
2026-03-19 14:54:09 +03:00
parent 7145b66e0e
commit 37036f8f75
26 changed files with 5466 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
@startuml
title Canvas/ViewPort: алгоритм вычисления видимой области и редроу
start
:Get zoomed document rect\n(getZoomedImageSize);
:Read viewport rect + scroll offset;
:Compute visible width/height\nmin(viewport, image size);
:Compute raw visible x/y\nfrom scroll - image offset;
:Clamp x/y into image bounds;
:Store Rect_i{x,y,w,h} as _visible_rect;
if (visible rect changed\nOR texture is null?) then (yes)
:request redraw;
else (no)
:no redraw needed;
endif
if (redraw pending?) then (yes)
:Read render quality %;
:Convert area-quality to side-scale\nscale = sqrt(q/100);
:Scale full canvas size;
:Scale visible rect;
:Clamp scaled rect to scaled canvas;
if (scaled visible rect valid?) then (yes)
:Render only scaled visible area\nthrough RenderEngine;
:Update texture + stats + throttle;
else (no)
:Drop texture / skip rendering;
endif
else (no)
:Keep previous frame;
endif
stop
@enduml