File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -186,6 +186,9 @@ const App = () => {
186186 id = "video"
187187 className = { clsx ( videoRotate === 0 ? [ videoStyle , "min-h-[480px] min-w-[640px]" ] : "hidden" ) }
188188 ref = { videoRef }
189+ style = { {
190+ transform : `scale(${ videoScale } )` ,
191+ } }
189192 autoPlay
190193 playsInline
191194 onLoadedMetadata = { setCanvas }
Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ const App = (): ReactElement => {
3030 const { t } = useTranslation ( )
3131 const isBigScreen = useMediaQuery ( { minWidth : 850 } )
3232
33- const videoScale = useAtomValue ( videoScaleAtom )
3433 const [ videoRotate , setVideoRotate ] = useAtom ( videoRotateAtom )
34+ const [ videoScale , setVideoScale ] = useAtom ( videoScaleAtom )
3535 const videoState = useAtomValue ( videoStateAtom )
3636 const serialPortState = useAtomValue ( serialPortStateAtom )
3737 const mouseStyle = useAtomValue ( mouseStyleAtom )
@@ -112,18 +112,23 @@ const App = (): ReactElement => {
112112 } , [ videoRotate ] )
113113
114114 useEffect ( ( ) => {
115- const rotate = storage . getVideoRotate ( )
116- if ( rotate ) {
117- setVideoRotate ( rotate )
118- }
119-
120115 const resolution = storage . getVideoResolution ( )
121116 if ( resolution ) {
122117 setResolution ( resolution )
123118 }
124119
125120 requestMediaPermissions ( resolution )
126121
122+ const rotate = storage . getVideoRotate ( )
123+ if ( rotate ) {
124+ setVideoRotate ( rotate )
125+ }
126+
127+ const scale = storage . getVideoScale ( )
128+ if ( scale ) {
129+ setVideoScale ( scale )
130+ }
131+
127132 return ( ) : void => {
128133 camera . close ( )
129134 window . electron . ipcRenderer . invoke ( IpcEvents . CLOSE_SERIAL_PORT )
@@ -199,6 +204,9 @@ const App = (): ReactElement => {
199204 id = "video"
200205 className = { clsx ( videoRotate === 0 ? [ videoStyle , 'min-h-[480px] min-w-[640px]' ] : 'hidden' ) }
201206 ref = { videoRef }
207+ style = { {
208+ transform : `scale(${ videoScale } )`
209+ } }
202210 autoPlay
203211 playsInline
204212 onLoadedMetadata = { setCanvas }
You can’t perform that action at this time.
0 commit comments