caret inset fix
This commit is contained in:
parent
c3edec4050
commit
d3d32db2fa
@ -121,22 +121,22 @@ open class CaretView: View {
|
|||||||
switch direction {
|
switch direction {
|
||||||
case .up:
|
case .up:
|
||||||
caretPath.move(to: CGPoint(x: inset, y: frame.size.height - inset))
|
caretPath.move(to: CGPoint(x: inset, y: frame.size.height - inset))
|
||||||
caretPath.addLine(to: CGPoint(x: halfWidth, y: lineWidth))
|
caretPath.addLine(to: CGPoint(x: halfWidth, y: inset))
|
||||||
caretPath.addLine(to: CGPoint(x: frame.size.width, y: frame.size.height))
|
caretPath.addLine(to: CGPoint(x: frame.size.width, y: frame.size.height))
|
||||||
|
|
||||||
case .right:
|
case .right:
|
||||||
caretPath.move(to: CGPoint(x: inset, y: inset))
|
caretPath.move(to: CGPoint(x: inset, y: inset))
|
||||||
caretPath.addLine(to: CGPoint(x: frame.size.width - lineWidth, y: halfHeight))
|
caretPath.addLine(to: CGPoint(x: frame.size.width - inset, y: halfHeight))
|
||||||
caretPath.addLine(to: CGPoint(x: inset, y: frame.size.height - inset))
|
caretPath.addLine(to: CGPoint(x: inset, y: frame.size.height - inset))
|
||||||
|
|
||||||
case .down:
|
case .down:
|
||||||
caretPath.move(to: CGPoint(x: inset, y: inset))
|
caretPath.move(to: CGPoint(x: inset, y: inset))
|
||||||
caretPath.addLine(to: CGPoint(x: halfWidth, y: frame.size.height - lineWidth))
|
caretPath.addLine(to: CGPoint(x: halfWidth, y: frame.size.height - inset))
|
||||||
caretPath.addLine(to: CGPoint(x: frame.size.width - inset, y: inset))
|
caretPath.addLine(to: CGPoint(x: frame.size.width - inset, y: inset))
|
||||||
|
|
||||||
case .left:
|
case .left:
|
||||||
caretPath.move(to: CGPoint(x: frame.size.width - inset, y: inset))
|
caretPath.move(to: CGPoint(x: frame.size.width - inset, y: inset))
|
||||||
caretPath.addLine(to: CGPoint(x: lineWidth, y: halfHeight))
|
caretPath.addLine(to: CGPoint(x: inset, y: halfHeight))
|
||||||
caretPath.addLine(to: CGPoint(x: frame.size.width - inset, y: frame.size.height - inset))
|
caretPath.addLine(to: CGPoint(x: frame.size.width - inset, y: frame.size.height - inset))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user