/** * Determines the optimal spacing between tick marks in the slider for a given pixel density * Increments until a minimum amount of slate units specified by MinTick is reached * * @param InPixelsPerInput The density of pixels between each input * @param MinTick The minimum slate units per tick allowed * @param MinTickSpacing The minimum tick spacing in time units allowed * @return the optimal spacing in time units */ float DetermineOptimalSpacing( float InPixelsPerInput, uint32 MinTick, float MinTickSpacing ) { uint32 CurStep = 0; // Start with the smallest spacing float Spacing = MinTickSpacing; while( Spacing * InPixelsPerInput < MinTick ) { Spacing = MinTickSpacing * GetNextSpacing( CurStep ); CurStep++; } return Spacing; }
float FVisualLoggerTimeSliderController::DetermineOptimalSpacing(float InPixelsPerInput, uint32 MinTick, float MinTickSpacing) const { uint32 CurStep = 0; // Start with the smallest spacing float Spacing = MinTickSpacing; while( Spacing * InPixelsPerInput < MinTick ) { Spacing = MinTickSpacing * GetNextSpacing( CurStep ); CurStep++; } return Spacing; }