@@ -72,8 +72,6 @@ const SnapbackZoom: React.FC<SnapBackZoomProps> = ({
7272 } , [ resizeConfig , containerSize , scale ] ) ;
7373
7474 useDerivedValue ( ( ) => {
75- const { width, height } = childrenSize . value ;
76-
7775 const state : SnapbackZoomState < number > = {
7876 size : {
7977 width : containerSize . width . value ,
@@ -83,17 +81,20 @@ const SnapbackZoom: React.FC<SnapBackZoomProps> = ({
8381 x : position . x . value ,
8482 y : position . y . value ,
8583 } ,
86- translateX : translate . x . value ,
87- translateY : translate . y . value ,
84+ translateX : translate . x . value - childrenSize . value . deltaX ,
85+ translateY : translate . y . value - childrenSize . value . deltaY ,
8886 scale : scale . value ,
8987 } ;
9088
9189 if ( resizeConfig !== undefined ) {
92- state . resize = { width, height } ;
90+ state . resize = {
91+ width : childrenSize . value . width ,
92+ height : childrenSize . value . height ,
93+ } ;
9394 }
9495
9596 onUpdate ?.( state ) ;
96- } , [ childrenSize , position , containerSize , resizeConfig , translate , scale ] ) ;
97+ } , [ containerSize , position , childrenSize , resizeConfig , translate , scale ] ) ;
9798
9899 const pinch = Gesture . Pinch ( )
99100 . withTestId ( 'pinch' )
0 commit comments