-
Notifications
You must be signed in to change notification settings - Fork 143
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
[Fabric] Add support for image content mode and tint features #1828
[Fabric] Add support for image content mode and tint features #1828
Conversation
Does this PR affect the paper implementation/ mean we can remove some diffs from the paper implementation? |
Due to how much changes it would require to update the paper RCTImageView to use the RCTUIImageView, I'd do that as a separate PR. It would allow to reduce the macOS specific changes drastically due to the use of CALayer's scaling modes which are much closer to how iOS UIView scale content and so we'd be able to remove all the manual image scaling done on macOS. |
Filed #1832 to track this, so that it's at least written down somewhere and doesn't slip my mind. Makes sense to not do it with this PR! |
…oft#1828) * Add RCTUIImageView to RCTUIKit to support iOS features on macOS. * Add support for tint and resize mode to Image on Fabric. * Clean up logging and add macOS tag. * Fix code style to match the style guide. --------- Co-authored-by: Nick <lefever@meta.com>
* [Fabric] Return active touch identifiers in surface touch handler on mouse up. (#1815) Co-authored-by: Nick <lefever@meta.com> * [Fabric] Add mandatory color space conversion for macOS. (#1813) Co-authored-by: Nick <lefever@meta.com> * [Fabric] Clean up hit testing now that RCTUIView extends RCTPlatformView (#1814) * Clean up surface touch handler now that RCTUIView extends RCTPlatformView. * Fix the iOS build. --------- Co-authored-by: Nick <lefever@meta.com> * [Fabric] Use the layout metrics to get the scale factor in component views. (#1816) * Use the layout metrics to get the scale factor in component views. * Use layout metrics pointScaleFactor instead of RCTScreenScale on iOS. --------- Co-authored-by: Nick <lefever@meta.com> * Fix RNTester content not resizing with window. (#1818) Co-authored-by: Nick <lefever@meta.com> * Fix wrong text offset when a line height is set. (#1819) Co-authored-by: Nick <lefever@meta.com> * [Fabric] Fix scroll views hiding content underneath them in Fabric. (#1820) * Fix scroll views hiding content underneath them in Fabric. * Clean up Paper scroll view after shim scroll view fix. --------- Co-authored-by: Nick <lefever@meta.com> * [Fabric] Add support for image content mode and tint features (#1828) * Add RCTUIImageView to RCTUIKit to support iOS features on macOS. * Add support for tint and resize mode to Image on Fabric. * Clean up logging and add macOS tag. * Fix code style to match the style guide. --------- Co-authored-by: Nick <lefever@meta.com> * [Fabric] Fix text input rendering crashing by using layout metrics pixelScaleFactor (#1817) * Use layout metrics to assign the active scale factor to RCTUITextField. * Use layout metrics to assign the active scale factor to RCTUITextView. --------- Co-authored-by: Nick <lefever@meta.com> * [Fabric] Tint images using CIFilter fixing wrong tinted image size (#1843) * Tint images using CIFilter to fix wrong image size when enabling tinting. * Initialize the CIFilter input values with default values. --------- Co-authored-by: Nick <lefever@meta.com> --------- Co-authored-by: Nick <lefever@meta.com>
Please select one of the following
Summary
This PR adds the
RCTUIImageView
class to RCTUIKit offering the same API as the UIImageView on iOS for setting the content mode and the tint color. The implementation uses CALayer and NSImage for scale settings which matches the iOS scaling methods.Using this image view implementation on fabric removes most of the macOS specific code changes that the
RCTImageComponentView
required previously.Changelog
[macOS] [FIXED] - Image content mode and tinting in Fabric
Test Plan
Tested by running RNTester on macOS with fabric (
RCT_NEW_ARCH_ENABLED=1
) and launching the Image example.With the fix:
Without the fix: