File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " react-three-map " : patch
3+ ---
4+
5+ Revert 748d7a7: Fix issues on DPR or browser zoom changes.
Original file line number Diff line number Diff line change @@ -74,9 +74,15 @@ export function useOnAdd(
7474 } )
7575
7676 const onResize = useFunction ( ( ) => {
77+ if ( ! r3mRef . current . map ) return ;
7778 if ( ! r3mRef . current . state ) return ;
78- // because we update size out of zustand, we just want to let it know that something changed
79- r3mRef . current . state . set ( { } ) ;
79+ const canvas = r3mRef . current . map . getCanvas ( ) ;
80+ r3mRef . current . state . setSize (
81+ canvas . clientWidth ,
82+ canvas . clientHeight ,
83+ false
84+ ) ;
85+
8086 } )
8187
8288 const onRemove = useFunction ( ( ) => {
Original file line number Diff line number Diff line change @@ -11,8 +11,6 @@ export function useRender(
1111 const render = useFunction ( ( _gl : WebGL2RenderingContext , mapCamMx : number [ ] ) => {
1212 const r3m = r3mRef . current ;
1313 if ( ! r3m . state || ! r3m . map ) return ;
14- r3m . state . size . width = r3m . state . gl . domElement . clientWidth ;
15- r3m . state . size . height = r3m . state . gl . domElement . clientHeight ;
1614 const camera = r3m . state . camera ;
1715 const gl = r3m . state . gl ;
1816 const advance = r3m . state . advance ;
You can’t perform that action at this time.
0 commit comments