Closed hunkim98 closed 1 year ago
After working on grid size change enhancement #4 , I realized that it is impossible to remove the dependencey on panzoom when grid size changes. This is because when grid size change occurs, the panzoom should be modified to let the grid extension point follow the mouse cursor. I will close this issue.
Currently if you see the grid size change part, you can see that setPanZoom is called every time.
https://github.com/hunkim98/dotting/blob/6c38fbd7c103467679a139d6ea4246b77340a3a8/src/components/Canvas/Editor.tsx#L523C5-L579
Setting panzoom everytime causes all canvases to render because all canvases rely on the panzoom.
However changing panzoom when user changes the grid size seems quite unnecessary. Why do we need to change the panZoom when we change the grid size?
The reason such nuisance occurred is because I poorly designed the grid extension mechanism. I believe I designed it this way because I have considered users extending the grid even when their mouse has left the canvas.
Maybe a deeper analysis on this issue is necessary. Maybe we could eliminate setPanZoom method for grid size changes?