From 6c4fb1c5ba01ce1475053fdd6d4828ca1a992ff8 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 7 Aug 2024 16:42:19 -0500 Subject: [PATCH] moved code up to 1 point rather than duplicating Signed-off-by: Matt Bruce --- VDS/Components/InputStepper/InputStepper.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/VDS/Components/InputStepper/InputStepper.swift b/VDS/Components/InputStepper/InputStepper.swift index 11fde045..9302d0ec 100644 --- a/VDS/Components/InputStepper/InputStepper.swift +++ b/VDS/Components/InputStepper/InputStepper.swift @@ -361,18 +361,16 @@ open class InputStepper: EntryFieldBase { return } + // Set the inputStepper's controlWidth based on percentage received relative to its parentView's frame. + let containerWidth: CGFloat = widthConstraintConstant ?? containerView.frame.size.width var stepperWidthConstant: CGFloat? var stepperWidth: CGFloat - var containerWidth: CGFloat switch controlWidth { case .percentage(let percentage): - // Set the inputStepper's controlWidth based on percentage received relative to its parentView's frame. - containerWidth = widthConstraintConstant ?? CGFloat(containerView.frame.size.width) stepperWidth = max(containerWidth * ((percentage) / 100), minWidth) case .value(let value): - containerWidth = widthConstraintConstant ?? CGFloat(containerView.frame.size.width) stepperWidth = value }