-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Changes from 1 commit
25fa661
d2715fc
184e4ca
71be3ee
2bc6fa6
f4c50c9
fe81aaa
b05db83
aee1d1e
5aa5749
bf03160
ee96405
eb3d169
25ab7dc
0dc63b0
43876b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -210,7 +210,7 @@ class ImageView extends PureComponent { | |||||
style={this.state.zoomScale === 0 ? undefined : [ | ||||||
styles.w100, | ||||||
styles.h100, | ||||||
]} // Hide image until zoomScale scale calculated | ||||||
]} // Hide image until zoomScale calculated | ||||||
resizeMode={this.state.zoomScale > 1 ? 'center' : 'contain'} // For big dimension images 'contain' works much effective | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Improve this comment. You should tell how that is more effective and what is the effect. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Best thing to do would be find why image is all stretched on mWeb while it work great on Web. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That code doesn't work on the web. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I meant to ask why image is all stretched on mWeb while it work great on Web for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the web side, there is a <Pressable
style={{
...StyleUtils.getZoomSizingStyle(this.state.isZoomed, this.state.imgWidth, this.state.imgHeight, this.state.zoomScale,
this.state.containerHeight, this.state.containerWidth),
...StyleUtils.getZoomCursorStyle(this.state.isZoomed, this.state.isDragging),
...this.state.isZoomed && this.state.zoomScale >= 1 ? styles.pRelative : styles.pAbsolute,
...styles.flex1,
}}
>
<Image
source={{uri: this.props.url}}
style={this.state.zoomScale === 0 ? undefined : [
styles.w100,
styles.h100,
]} // Hide image until zoomScale calculated
resizeMode="contain"
onLoadStart={this.imageLoadingStart}
onLoadEnd={this.imageLoadingEnd}
/>
{this.state.isLoading && (
<FullscreenLoadingIndicator
style={[styles.opacity1, styles.bgTransparent]}
/>
)}
</Pressable> There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, then leave this |
||||||
onLoadStart={this.imageLoadingStart} | ||||||
onLoadEnd={this.imageLoadingEnd} | ||||||
|
@@ -250,7 +250,7 @@ class ImageView extends PureComponent { | |||||
style={this.state.zoomScale === 0 ? undefined : [ | ||||||
styles.h100, | ||||||
styles.w100, | ||||||
]} // Hide image until zoomScale scale calculated | ||||||
]} // Hide image until zoomScale calculated | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
resizeMode="contain" | ||||||
onLoadStart={this.imageLoadingStart} | ||||||
onLoadEnd={this.imageLoadingEnd} | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.