Skip to content

Conversation

@brentvatne
Copy link
Collaborator

@vjeux and I were discussing this in irc an discovered that network gif images did not respond how they should to width, height or flex properties. This PR fixes that, so now you can do flex: 1 on a gif image to have it stretch to the whole screen. Minimum reproducible example here - try this without and then with the changes of this PR to see.

@vjeux
Copy link
Contributor

vjeux commented Mar 27, 2015

@a2

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is unnecessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, removed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line is unnecessary but I may be wrong.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remove it then the image does not show up at all, so it seems necessary

@brentvatne
Copy link
Collaborator Author

@a2 - thanks for the feedback, let me know if there's anything else you'd like me to do here!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically we don't currently support @2x or @3x GIFs so maybe change the contentsScale to 1.0? Or, if you want to keep RCTScreenScale(), we need to add that support, maybe by checking the filename suffix before the extension.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@a2 - good point, let's just make this 1.0 and we can open a separate issue for @2x+ support if you like

@a2
Copy link
Contributor

a2 commented Mar 27, 2015

👍

@brentvatne brentvatne changed the title Make bounds and scale of gif network images respond to device and styles Make bounds and resizeMode of gif network images respond to styles Mar 27, 2015
@sahrens
Copy link
Contributor

sahrens commented Apr 1, 2015

Merged internally and synced.

@sahrens sahrens closed this Apr 1, 2015
vjeux pushed a commit to vjeux/react-native that referenced this pull request Apr 13, 2015
Summary:
@vjeux and I were discussing this in irc an discovered that network gif images did not respond how they should to width, height or flex properties. Along the way I also noticed that the scale was not changing depending on the device. This PR fixes that, so now you can do `flex: 1` on a gif image to have it stretch to the whole screen. [Minimum reproducible example here](https://gist.github.com/brentvatne/f745377b0789162a28df) - try this without and then with the changes of this PR to see.
Closes facebook#353
Github Author: Brent Vatne <[email protected]>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
vjeux pushed a commit to vjeux/react-native that referenced this pull request Apr 14, 2015
Summary:
@vjeux and I were discussing this in irc an discovered that network gif images did not respond how they should to width, height or flex properties. Along the way I also noticed that the scale was not changing depending on the device. This PR fixes that, so now you can do `flex: 1` on a gif image to have it stretch to the whole screen. [Minimum reproducible example here](https://gist.github.com/brentvatne/f745377b0789162a28df) - try this without and then with the changes of this PR to see.
Closes facebook#353
Github Author: Brent Vatne <[email protected]>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
vjeux pushed a commit to vjeux/react-native that referenced this pull request Apr 15, 2015
Summary:
@vjeux and I were discussing this in irc an discovered that network gif images did not respond how they should to width, height or flex properties. Along the way I also noticed that the scale was not changing depending on the device. This PR fixes that, so now you can do `flex: 1` on a gif image to have it stretch to the whole screen. [Minimum reproducible example here](https://gist.github.com/brentvatne/f745377b0789162a28df) - try this without and then with the changes of this PR to see.
Closes facebook#353
Github Author: Brent Vatne <[email protected]>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
jfrolich pushed a commit to jfrolich/react-native that referenced this pull request Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants