-
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
fix: 16528 upload gif image fluctuate #17454
Changes from 6 commits
8282225
db6cfbf
b05be87
ef16bed
92b60d7
ed4470a
40bc8b0
2e06be8
63e7599
19780e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -196,14 +196,13 @@ function getZoomCursorStyle(isZoomed, isDragging) { | |||||||
* @param {Number} zoomScale | ||||||||
* @param {Number} containerHeight | ||||||||
* @param {Number} containerWidth | ||||||||
* @return {Object} | ||||||||
* @param {Boolean} isLoading | ||||||||
* @returns {Object | undefined} | ||||||||
*/ | ||||||||
function getZoomSizingStyle(isZoomed, imgWidth, imgHeight, zoomScale, containerHeight, containerWidth) { | ||||||||
if (imgWidth === 0 || imgHeight === 0) { | ||||||||
return { | ||||||||
height: isZoomed ? '250%' : '100%', | ||||||||
width: isZoomed ? '250%' : '100%', | ||||||||
}; | ||||||||
function getZoomSizingStyle(isZoomed, imgWidth, imgHeight, zoomScale, containerHeight, containerWidth, isLoading) { | ||||||||
// Hide image until finished loading to prevent showing preview with wrong dimensions | ||||||||
if (isLoading || imgWidth === 0 || imgHeight === 0) { | ||||||||
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
|
||||||||
return undefined; | ||||||||
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
Or if we have to return 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. @eVoloshchak I prefer using undefined. I tested all platforms with undefined and I believe it works well. And changing |
||||||||
} | ||||||||
const top = `${Math.max((containerHeight - imgHeight) / 2, 0)}px`; | ||||||||
const left = `${Math.max((containerWidth - imgWidth) / 2, 0)}px`; | ||||||||
|
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.
I want to change this line because it can improve the performance a bit. isLoading is always set to true then false when image is loaded.
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.
Yeah, I agree, it should be set to true initially
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.
Is this ready for testing?