()
| 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(); |
no test coverage detected