moved code up to 1 point rather than duplicating
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
cbdd82ee31
commit
6c4fb1c5ba
@ -361,18 +361,16 @@ open class InputStepper: EntryFieldBase<Int> {
|
|||||||
return
|
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 stepperWidthConstant: CGFloat?
|
||||||
var stepperWidth: CGFloat
|
var stepperWidth: CGFloat
|
||||||
var containerWidth: CGFloat
|
|
||||||
|
|
||||||
switch controlWidth {
|
switch controlWidth {
|
||||||
case .percentage(let percentage):
|
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)
|
stepperWidth = max(containerWidth * ((percentage) / 100), minWidth)
|
||||||
|
|
||||||
case .value(let value):
|
case .value(let value):
|
||||||
containerWidth = widthConstraintConstant ?? CGFloat(containerView.frame.size.width)
|
|
||||||
stepperWidth = value
|
stepperWidth = value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user