Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed: small images for scaling problem #8761

Merged
merged 16 commits into from
Jul 11, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
in setImageRegion function imageHeight condition added
  • Loading branch information
metehanozyurt committed Apr 30, 2022
commit 71be3ee3b2f6a4c311d13b1bb66a9197f1eed648
5 changes: 5 additions & 0 deletions src/components/ImageView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ class ImageView extends PureComponent {
const containerHeight = this.state.containerHeight;
const containerWidth = this.state.containerWidth;

// return if image not loaded yet
if (imageHeight <= 0) {
return;
}

let imgLeft = (this.props.windowWidth - width) / 2;
let imgRight = ((this.props.windowWidth - width) / 2) + width;
let imgTop = (this.props.windowHeight - height) / 2;
Expand Down