fix(FitPlugin): handle edge cases in fitCenter calculation by tbouffard · Pull Request #831 · maxGraph/maxGraph

@tbouffard

Prevent division by zero and non-finite scaling values when graph
bounds have zero dimensions (width/height = 0) or when container
is improperly sized. Maintains original scale in these invalid
scenarios to ensure consistent behavior.

This issue particularly used to affect headless environments (tests, Node.js)
where containers may have zero height/width, which is less common in
browser contexts.

@tbouffard added the bug

Something isn't working

label

May 19, 2025

coderabbitai[bot]

@tbouffard tbouffard deleted the fix/FitPlugin_fitCenter_improve_robustness branch

May 19, 2025 17:13

This was referenced

May 19, 2025