                     newWidth = max(newWidth, MoView.minWidth)
                 }
                 // right
-                if (newX + newWidth > superX + superviewBoundWidth() &&
+                if (newX + newWidth > superX + superviewContentWidth() &&
                     self.frame.size.width != newWidth) {
-                    newWidth = superviewBoundWidth() - newX;
+                    newWidth = superviewContentWidth() - newX;
                     newWidth = max(newWidth, MoView.minWidth)
                 }
                 // top

    }
    
    override open func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        // If a e.g. UITextView isFirstResponder, the touch might be cancelled abruptly
        superview?.endEditing(true)
        delegate?.moViewDidBeginEditing(self)

        return smallestDist < centerDist * resizeDistanceToCenterFactor ? closestAnchor : noAnchor
    }
    
    fileprivate func superviewContentWidth() -> CGFloat {
        guard let superview = superview else {
            return 0
        }
