   ///  - parameter radius:      Border radius
   ///  - parameter color:       Border color
   fileprivate func drawBorderAtBottom(width borderWidth: CGFloat, radius: CGFloat, color: NSColor) {
+    let yPosition = isFlipped ? frame.size.height - borderWidth : 0
     let borderFrame = CGRect(
       x: 0,
-      y: 0,
+      y: yPosition,
       width: frame.size.width,
       height: borderWidth
     )

    width: CGFloat,
    radius: CGFloat,
    color: NSColor
    ) {
    let borderLayer = CALayer()

    borderLayer.borderColor = color.cgColor

  ///  - parameter radius:      Border radius
  ///  - parameter color:       Border color
  fileprivate func drawBorderAtTop(width borderWidth: CGFloat, radius: CGFloat, color: NSColor) {
    let yPosition = isFlipped ? 0 : frame.size.height - borderWidth
    let borderFrame = CGRect(
      x: 0,
      y: yPosition,
      width: frame.size.width,
      height: borderWidth
    )
