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:
Generated
-1
@@ -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
@@ -13,4 +13,4 @@
|
||||
"simulatorType": "wechat",
|
||||
"simulatorPluginLibVersion": {},
|
||||
"condition": {}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user