JTAppleCalendar
JTAppleCalendar copied to clipboard
errorDelta value in scrollToSegment
(Required) Version Number: v.8.0.0. ipad
Description
My calendarView frame.width(fixedScrollSize) is 931.875 and scrollMode is horizontal I just did scrollToSegment(.next) in my project, but it doesn't scroll next section every four months.
Then I read your scrollToSegment code and I found that difference between rounded section value and my section value is higher than your errorDelta value. For example, in section 55 my section value comes 54.99986586183769.
So When I change error Delta to 0.001. It works fine. Please fix this error.
Steps To Reproduce
Expected Behavior
Additional Context
will fix
Hmm, The code i have there is
if abs(roundedSection - section) < errorDelta { section = roundedSection }
and my errorDelta is
let errorDelta: CGFloat = 0.0000001
So are you saying that your value was less than this? I am confused because you are setting it at a higher value
When I call scrollToSegment(.next),
abs(roundedSection - section)
value is bigger than errorDelta. So It didn't scroll to next segment.
This bug just occur periodically.
ok thanks. In that case, I think i need better logic than using an error delta. I'll rethink this over the weekend.
In my case, My fixed scroll Size is 931.875, but difference between each section offset value is 932 or 931.5(periodically).
I hope it'll be helpful.
Hi. Is is fixed?