Public Access
32 lines
771 B
C#
32 lines
771 B
C#
namespace MeetingAssistant.Workflow;
|
|
|
|
internal static class WorkflowRulesEditorScrollPolicy
|
|
{
|
|
private const double BottomTolerance = 8;
|
|
|
|
public static bool ShouldAutoScroll(
|
|
double verticalOffset,
|
|
double viewportHeight,
|
|
double previousContentHeight)
|
|
{
|
|
if (viewportHeight <= 0 || previousContentHeight <= 0)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
if (previousContentHeight <= viewportHeight)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
return verticalOffset + viewportHeight >= previousContentHeight - BottomTolerance;
|
|
}
|
|
|
|
public static double GetBottomOffset(
|
|
double viewportHeight,
|
|
double contentHeight)
|
|
{
|
|
return Math.Max(0, contentHeight - viewportHeight);
|
|
}
|
|
}
|