From ebd4418f39ae78c2806883cfc6508110522b41ad Mon Sep 17 00:00:00 2001 From: Louis D'hauwe Date: Thu, 23 Feb 2017 01:53:01 +0100 Subject: [PATCH] Don't assume 0 margin for panelContentView top and bottom --- PanelKit/PanelManager/PanelManager.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PanelKit/PanelManager/PanelManager.swift b/PanelKit/PanelManager/PanelManager.swift index 32cd438..0688aca 100644 --- a/PanelKit/PanelManager/PanelManager.swift +++ b/PanelKit/PanelManager/PanelManager.swift @@ -297,8 +297,8 @@ extension PanelManager { // Recreate them - panelContentView.topAnchor.constraint(equalTo: panelContentWrapperView.topAnchor).isActive = true - panelContentView.bottomAnchor.constraint(equalTo: panelContentWrapperView.bottomAnchor).isActive = true + panelContentView.topAnchor.constraint(equalTo: panelContentWrapperView.topAnchor, constant: frame.origin.y).isActive = true + panelContentView.bottomAnchor.constraint(equalTo: panelContentWrapperView.bottomAnchor, constant: panelContentWrapperView.bounds.height - frame.maxY).isActive = true panelContentView.leadingAnchor.constraint(equalTo: panelContentWrapperView.leadingAnchor, constant: frame.origin.x).isActive = true