                                y: hollowFrame.minY - spacing - imageSize.height,
                                width: imageSize.width,
                                height: imageSize.height)
-            var x: CGFloat = 0
-            if size.width < hollowFrame.size.width {
-                x = arrowRect.maxX - size.width / 2
-            } else {
-                x = padding
-            }
-            textRect = CGRect(x: min(x, maxX),
+            let x: CGFloat = min(maxX, arrowRect.maxX - size.width / 2)
+            textRect = CGRect(x: x,
                               y: arrowRect.minY - spacing - size.height,
                               width: size.width,
                               height: size.height)

                               y: hollowFrame.maxY + spacing,
                               width: imageSize.width,
                               height: imageSize.height)
            var x: CGFloat = 0
            if size.width < hollowFrame.size.width {
                x = arrowRect.minX - size.width / 2
            } else {
                x = padding + maxWidth - size.width
            }
            textRect = CGRect(x: min(x, maxX),
                              y: arrowRect.maxY + spacing,
                              width: size.width,
                              height: size.height)

                               y: hollowFrame.minY - spacing - imageSize.height,
                               width: imageSize.width,
                               height: imageSize.height)
            let x: CGFloat = min(maxX, arrowRect.minX - size.width / 2)
            textRect = CGRect(x: x,
                              y: arrowRect.minY - spacing - size.height,
                              width: size.width,
                              height: size.height)
