Closed gunnartorfis closed 1 year ago
I can do my calculations without it, sorry about that.
I can do my calculations without it, sorry about that.
How did you do ? I also need to calculate the event height to place some cursors on the event based on the timeIntervalHeight
edit: found the solution
const paddingTopStart = useDerivedValue(() => {
return (timeIntervalHeight.value / 60) * pause_start
}, [pause_start, timeIntervalHeight])
const paddingTopEnd = useDerivedValue(() => {
return (timeIntervalHeight.value / 60) * pause_end
}, [pause_end, timeIntervalHeight])
const startLineStyle = useAnimatedStyle(() => {
return {
top: paddingTopStart.value,
height: paddingTopEnd.value - paddingTopStart.value,
}
})
Adding a onZoomIntervalChange would allow us to do some calculations inside renderEventContent.
For my case, I'm rendering a multi-event type event where each of the event types has to take X % of the total event's height. In order for me to calculate that, I need the current interval height - if I want to have pinch to zoom enabled.
I guess it could be added here? https://github.com/howljs/react-native-calendar-kit/blob/da8c653e55ce33d3c41e7190b1342632cb69adaf/src/hooks/usePinchGesture.tsx#L55