Skip to content

Commit 7cf3f6d

Browse files
committed
Anchor fix for .leading and .top
1 parent 11c59be commit 7cf3f6d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Sources/SwiftTooltipKit/Extensions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ extension UIView {
122122
let centerYAnchor = tooltip.centerYAnchor.constraint(equalTo: self.centerYAnchor)
123123
centerYAnchor.priority = .defaultHigh
124124
NSLayoutConstraint.activate([
125-
tooltip.trailingAnchor.constraint(equalTo: self.leadingAnchor, constant: configuration.offset),
125+
tooltip.trailingAnchor.constraint(equalTo: self.leadingAnchor, constant: -configuration.offset),
126126
centerYAnchor
127127
])
128128
case .trailing, .right:
@@ -136,7 +136,7 @@ extension UIView {
136136
let centerXAnchor = tooltip.centerXAnchor.constraint(equalTo: self.centerXAnchor)
137137
centerXAnchor.priority = .defaultHigh
138138
NSLayoutConstraint.activate([
139-
tooltip.bottomAnchor.constraint(equalTo: self.topAnchor, constant: configuration.offset),
139+
tooltip.bottomAnchor.constraint(equalTo: self.topAnchor, constant: -configuration.offset),
140140
centerXAnchor
141141
])
142142
case .bottom:

0 commit comments

Comments
 (0)