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(
74
74
} )
75
75
76
76
const onResize = useFunction ( ( ) => {
77
+ if ( ! r3mRef . current . map ) return ;
77
78
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
+
80
86
} )
81
87
82
88
const onRemove = useFunction ( ( ) => {
Original file line number Diff line number Diff line change @@ -11,8 +11,6 @@ export function useRender(
11
11
const render = useFunction ( ( _gl : WebGL2RenderingContext , mapCamMx : number [ ] ) => {
12
12
const r3m = r3mRef . current ;
13
13
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 ;
16
14
const camera = r3m . state . camera ;
17
15
const gl = r3m . state . gl ;
18
16
const advance = r3m . state . advance ;
You can’t perform that action at this time.
0 commit comments