Avoid having an element that covers the pinch zoom

This commit is contained in:
Jake Archibald
2018-10-21 09:24:11 +01:00
parent b36014c74a
commit c32b9a36bf
2 changed files with 22 additions and 28 deletions

View File

@@ -400,7 +400,7 @@ export default class Compress extends Component<Props, State> {
const [leftImageData, rightImageData] = images.map(i => i.data);
return (
<div class={style.compress}>
<div class={`${style.compress} ${style[orientation]}`}>
<Output
originalImage={source && source.data}
orientation={orientation}
@@ -409,24 +409,22 @@ export default class Compress extends Component<Props, State> {
leftImgContain={leftImage.preprocessorState.resize.fitMethod === 'cover'}
rightImgContain={rightImage.preprocessorState.resize.fitMethod === 'cover'}
/>
<div class={`${style.optionPair} ${style[orientation]}`}>
{images.map((image, index) => (
<Options
loading={loading || image.loading}
source={source}
orientation={orientation}
imageIndex={index}
imageFile={image.file}
downloadUrl={image.downloadUrl}
preprocessorState={image.preprocessorState}
encoderState={image.encoderState}
onEncoderTypeChange={this.onEncoderTypeChange.bind(this, index)}
onEncoderOptionsChange={this.onEncoderOptionsChange.bind(this, index)}
onPreprocessorOptionsChange={this.onPreprocessorOptionsChange.bind(this, index)}
onCopyToOtherClick={this.onCopyToOtherClick.bind(this, index)}
/>
))}
</div>
{images.map((image, index) => (
<Options
loading={loading || image.loading}
source={source}
orientation={orientation}
imageIndex={index}
imageFile={image.file}
downloadUrl={image.downloadUrl}
preprocessorState={image.preprocessorState}
encoderState={image.encoderState}
onEncoderTypeChange={this.onEncoderTypeChange.bind(this, index)}
onEncoderOptionsChange={this.onEncoderOptionsChange.bind(this, index)}
onPreprocessorOptionsChange={this.onPreprocessorOptionsChange.bind(this, index)}
onCopyToOtherClick={this.onCopyToOtherClick.bind(this, index)}
/>
))}
</div>
);
}

View File

@@ -1,19 +1,15 @@
.compress {
height: 100%;
}
.option-pair {
display: flex;
width: 100%;
height: 100%;
contain: strict;
display: grid;
&.horizontal {
justify-content: space-between;
align-items: flex-end;
grid-template-columns: 1fr auto;
align-items: end;
}
&.vertical {
flex-direction: column;
justify-content: flex-end;
// TODO
}
}