instea / react-native-color-picker

Color picker component for IOS/Android
Apache License 2.0
272 stars 67 forks source link

Center color circle loose circle shape when defining 'oldColor' params #44

Open nikoden-io opened 3 years ago

nikoden-io commented 3 years ago

Hello here,

First of all thanks for your work on this one !

I have an issue: when I set a value for oldColor params the center circle (with old/current color) switch from a perfect circle to something strange between square and circle I would say.

Any idea of the origin of that ? Thanks a lot for infos

phantom-factotum commented 2 years ago

I have the same issue. The "squircle" only happens on ios for me. It looks like to me that the very top and bottom parts of the circle is being clipped off screen

phantom-factotum commented 2 years ago

I resolved the issue by changing the following the StyleSheet

selectedPreview: {
        position: "absolute",
        borderColor:'transparent',
        borderWidth:1,
        borderLeftWidth:Platform.select({
            android:0,
            ios:null
        }),

    },
    originalPreview: {
        position: "absolute",
        borderColor:'transparent',
        borderWidth:1,
        borderRightWidth:Platform.select({
            android:0,
            ios:null
        }),
    },

I think by making the border widths 0 on iOS had some weird effect on the other border radiuses of the view. Idk