well functioning
This commit is contained in:
parent
fa439855b0
commit
b758c0d514
@ -92,16 +92,19 @@ open class OrderTracker: View {
|
|||||||
let startPoint = CGPoint(x: imageDimension / 2, y: firstRect.size.height - 1)
|
let startPoint = CGPoint(x: imageDimension / 2, y: firstRect.size.height - 1)
|
||||||
context.move(to: startPoint)
|
context.move(to: startPoint)
|
||||||
|
|
||||||
|
var lineColor = (firstStep.state?.color() ?? .mvmCoolGray3).cgColor
|
||||||
|
|
||||||
for step in steps.dropFirst() {
|
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 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.addLine(to: point)
|
||||||
context.strokePath()
|
context.strokePath()
|
||||||
|
|
||||||
let nextPoint = CGPoint(x: imageDimension / 2, y: relativeOrigin.origin.y + imageDimension)
|
let nextPoint = CGPoint(x: imageDimension / 2, y: relativeOrigin.origin.y + imageDimension)
|
||||||
|
lineColor = (step.state?.color() ?? .mvmCoolGray3).cgColor
|
||||||
context.move(to: nextPoint)
|
context.move(to: nextPoint)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,6 +49,7 @@ open class Step: View {
|
|||||||
addSubview(bodyTop)
|
addSubview(bodyTop)
|
||||||
addSubview(bodyBottom)
|
addSubview(bodyBottom)
|
||||||
|
|
||||||
|
stateImage.contentMode = .scaleToFill
|
||||||
stateImage.topAnchor.constraint(equalTo: topAnchor).isActive = true
|
stateImage.topAnchor.constraint(equalTo: topAnchor).isActive = true
|
||||||
stateImage.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
|
stateImage.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
|
||||||
stateImage.heightAnchor.constraint(equalToConstant: 18).isActive = true
|
stateImage.heightAnchor.constraint(equalToConstant: 18).isActive = true
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user