a couple more fixes from CR

This commit is contained in:
Jason Miller
2021-06-07 15:04:51 -04:00
parent 73b3fd0ef3
commit 6ed26ec70c

View File

@@ -1,11 +1,4 @@
import { import { h, Component, Fragment, createRef } from 'preact';
h,
Component,
Fragment,
createRef,
FunctionComponent,
ComponentChildren,
} from 'preact';
import type { import type {
default as PinchZoom, default as PinchZoom,
ScaleToOpts, ScaleToOpts,
@@ -29,7 +22,6 @@ import type { SourceImage } from '../../Compress';
import { PreprocessorState } from 'client/lazy-app/feature-meta'; import { PreprocessorState } from 'client/lazy-app/feature-meta';
import Cropper, { CropBox } from './Cropper'; import Cropper, { CropBox } from './Cropper';
import CanvasImage from '../CanvasImage'; import CanvasImage from '../CanvasImage';
import Expander from '../Options/Expander';
import Select from '../Options/Select'; import Select from '../Options/Select';
import Checkbox from '../Options/Checkbox'; import Checkbox from '../Options/Checkbox';
@@ -68,7 +60,6 @@ interface State {
scale: number; scale: number;
editingScale: boolean; editingScale: boolean;
rotate: typeof ROTATE_ORIENTATIONS[number]; rotate: typeof ROTATE_ORIENTATIONS[number];
// crop: false | CropBox;
crop: CropBox; crop: CropBox;
cropPreset: keyof typeof cropPresets | undefined; cropPreset: keyof typeof cropPresets | undefined;
lockAspect: boolean; lockAspect: boolean;
@@ -93,14 +84,6 @@ export default class Transform extends Component<Props, State> {
pinchZoom = createRef<PinchZoom>(); pinchZoom = createRef<PinchZoom>();
scaleInput = createRef<HTMLInputElement>(); scaleInput = createRef<HTMLInputElement>();
// static getDerivedStateFromProps({ source, preprocessorState }: Props) {
// return {
// rotate: preprocessorState.rotate.rotate || 0,
// crop: preprocessorState.crop || false,
// flip: preprocessorState.flip || { horizontal: false, vertical: false },
// };
// }
componentWillReceiveProps( componentWillReceiveProps(
{ source, preprocessorState }: Props, { source, preprocessorState }: Props,
{ crop, cropPreset }: State, { crop, cropPreset }: State,