well functioning

This commit is contained in:
Kevin G Christiano 2020-07-08 13:10:19 -04:00
parent fa439855b0
commit b758c0d514
2 changed files with 6 additions and 2 deletions

View File

@ -92,16 +92,19 @@ open class OrderTracker: View {
let startPoint = CGPoint(x: imageDimension / 2, y: firstRect.size.height - 1)
context.move(to: startPoint)
var lineColor = (firstStep.state?.color() ?? .mvmCoolGray3).cgColor
for step in steps.dropFirst() {
context.setStrokeColor((step.state?.color() ?? .mvmCoolGray3).cgColor)
context.setStrokeColor(lineColor)
let relativeOrigin = convert(step.stateImage.frame, from: step.stateImage)
let point = CGPoint(x: imageDimension / 2, y: relativeOrigin.origin.y)
let point = CGPoint(x: imageDimension / 2, y: relativeOrigin.origin.y + 1)
context.addLine(to: point)
context.strokePath()
let nextPoint = CGPoint(x: imageDimension / 2, y: relativeOrigin.origin.y + imageDimension)
lineColor = (step.state?.color() ?? .mvmCoolGray3).cgColor
context.move(to: nextPoint)
}
}

View File

@ -49,6 +49,7 @@ open class Step: View {
addSubview(bodyTop)
addSubview(bodyBottom)
stateImage.contentMode = .scaleToFill
stateImage.topAnchor.constraint(equalTo: topAnchor).isActive = true
stateImage.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
stateImage.heightAnchor.constraint(equalToConstant: 18).isActive = true