Skip to content

Commit 3414292

Browse files
authored
fix(android): fix LinearGradient when enabling RN props 2.0 (#2949)
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please follow the template so that the reviewers can easily understand what the code changes affect --> # Summary This is a follow up after the following PR. Please read this PR first to understand the context: - #2948 This fixes the default value for `LinearGradient`, which is especially important when enabling props 2.0 diffing mode. ## Test Plan ### What's required for testing (prerequisites)? Try to set the feature flags i mentioned and then observe the issues with linear gradient ### What are the steps to reproduce (after prerequisites)? ^ ## Compatibility | OS | Implemented | | ------- | :---------: | | iOS | ❌ | | MacOS | ❌ | | Android | ✅ | | Web | ❌ | ## Checklist <!-- Check completed item, when applicable, via: [X] --> - [x] I have tested this on a device and a simulator - [x] I added documentation in `README.md` - [x] I updated the typed files (typescript) - [x] I added a test for the API in the `__tests__` folder
1 parent bc005aa commit 3414292

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

android/src/main/java/com/horcrux/svg/LinearGradientView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class LinearGradientView extends DefinitionView {
2525
private SVGLength mX2;
2626
private SVGLength mY2;
2727
private ReadableArray mGradient;
28-
private Brush.BrushUnits mGradientUnits;
28+
private Brush.BrushUnits mGradientUnits = Brush.BrushUnits.OBJECT_BOUNDING_BOX;
2929

3030
private static final float[] sRawMatrix =
3131
new float[] {

0 commit comments

Comments
 (0)