kolking / react-native-page-indicator

React Native component designed to display the current page of a swiper, slideshow, carousel, and more.
MIT License
37 stars 1 forks source link

White Line in Morse Varient #12

Closed mktufan21 closed 10 months ago

mktufan21 commented 10 months ago

Hi @kolking , when we are using morse there is a white-line , please check the image, any idea how we can fix it

<PageIndicator count={images.length} current={currentPage} color={'#D3DAE1'} activeColor={'#606C70'} size={moderateScale(8,0.3)} variant='morse' dashSize={moderateScale(8,0.3)*4} borderRadius={moderateScale(8,0.3)/2} />

Screenshot 2023-08-16 at 7 14 55 PM
kolking commented 10 months ago

I suppose this is caused by some non-integer values produced by the moderateScale() function. Try something like this:

const size = Math.round(moderateScale(8,0.3));

<PageIndicator count={images.length} current={currentPage} color={'#D3DAE1'} activeColor={'#606C70'} size={size} variant='morse' dashSize={size*4} borderRadius={size/2} />

Btw, you don’t have to explicitly define dashSize={size*4} and borderRadius={size/2} since these are default. Thus, the below will produce the same result as above:

const size = Math.round(moderateScale(8,0.3));

<PageIndicator count={images.length} current={currentPage} color={'#D3DAE1'} activeColor={'#606C70'} size={size} variant='morse' />
chrissikora commented 10 months ago

Actually I am experiencing similar behaviour - very thin white line and my values are integers:

Screenshot 2023-08-23 at 9 22 16 am

Values:

size={8}
dashSize={18}
kolking commented 10 months ago

@chrissikora thanks for letting me know! I will do my best to figure out and fix the issue asap.

kolking commented 10 months ago

@chrissikora could you please provide more information since I wasn't able to reproduce the issue with the size and dashSize values you've mentioned. Are you seeing this in iOS or Android? Simulator or real device? What are the full list of props you're using for the component?

mktufan21 commented 10 months ago

@kolking little bit late , but this rounded does not fix the issue . for your above comment the issue I am facing in android emulator

kolking commented 10 months ago

@mktufan21 @chrissikora the issue should be resolved in v2.2.0. Appreciate your feedback, thanks!