MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / clampWikiGraphPan

Function clampWikiGraphPan

deployments/desktop/static/desktop.js:3787–3796  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3785 }
3786
3787 function clampWikiGraphPan() {
3788 const graph = $("wikiGraph");
3789 if (!graph) return;
3790 const rect = graph.getBoundingClientRect();
3791 const scale = state.wikiGraphTransform.scale;
3792 const limitX = Math.max(180, rect.width * scale * 0.7);
3793 const limitY = Math.max(180, rect.height * scale * 0.7);
3794 state.wikiGraphTransform.x = clamp(state.wikiGraphTransform.x, -limitX, limitX);
3795 state.wikiGraphTransform.y = clamp(state.wikiGraphTransform.y, -limitY, limitY);
3796 }
3797
3798 function applyWikiGraphTransform() {
3799 clampWikiGraphPan();

Callers 1

applyWikiGraphTransformFunction · 0.85

Calls 2

$Function · 0.70
clampFunction · 0.70

Tested by

no test coverage detected