1
0
mirror of https://github.com/SunnyQjm/taro-cropper.git synced 2026-06-05 15:39:32 +08:00

fix: 修复非全屏模式,Canvas高度设置错误的bug

This commit is contained in:
SunnyQjm
2019-08-18 10:42:59 +08:00
parent e8f322ac0e
commit 70ed5c6d7c
4 changed files with 4 additions and 4 deletions
Generated
-1
View File
@@ -2,6 +2,5 @@
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/src/components/image-cropper" vcs="Git" />
</component>
</project>
+1 -1
View File
@@ -13,4 +13,4 @@
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {}
}
}
+2 -1
View File
@@ -427,13 +427,14 @@ class TaroCropperComponent extends Taro.PureComponent<TaroCropperComponentProps,
} = this.props;
const canvasStyle: CSSProperties = {
background: 'rgba(0, 0, 0, 0.8)',
position: 'relative'
};
if (fullScreen) {
canvasStyle.width = `${this.systemInfo.windowWidth}px`;
canvasStyle.height = `${this.systemInfo.windowHeight}px`;
} else {
canvasStyle.width = `${width / 750 * this.systemInfo.windowWidth}px`;
canvasStyle.height = `${height / 750 * this.systemInfo.windowHeight}px`;
canvasStyle.height = `${height / 750 * this.systemInfo.windowWidth}px`;
}
return (
<Canvas
+1 -1
View File
@@ -53,7 +53,7 @@ export default class Index extends Component<IndexProps, IndexState> {
cropperHeight={400}
ref={this.catTaroCropper}
themeColor={'#f00'}
fullScreen
// fullScreen
onCut={res => {
this.setState({
cutImagePath: res