Closed soyox closed 10 months ago
<PhotoProvider loop={true} onIndexChange={handleIndexChange} toolbarRender={({ onScale, scale, rotate, onRotate }) => { return ( <div> {/*scale在每次点击后打印的值都会+1直至最大值,但图片不会缩放*/} <PlusCircleOutlined onClick={() => { console.log('scale', scale); onScale(scale + 1) }} /> <MinusCircleOutlined onClick={() => onScale(scale - 1)} /> <RedoOutlined onClick={() => onRotate(rotate + 90)} /> <UndoOutlined onClick={() => onRotate(rotate - 90)} /> <SyncOutlined onClick={() => onRotate(0)} /> {editable && <DownloadOutlined onClick={download} />} </div> ); }}> ... </PhotoProvider>
在有多张图片时能正常缩放和旋转
https://github.com/MinJieLiu/react-photo-view/issues/141
看起来是这个原因吧
fix: https://github.com/MinJieLiu/react-photo-view/commit/2ccf505e9ec2cd61335a9653a5d8845ae1d73644