     viewportUI.clipChildren = true;
     viewportUI.clipBorder = viewportUIClipBorder;
     viewportUI.RemoveAllChildren();
+    viewportUI.priority = -2000;
 
     Array<BorderImage@> borders;
 

        dragBorder.position = IntVector2(hPos, vPos);
    }

    // move all dependent borders
    Array<UIElement@> borders = viewportUI.GetChildren();
    for (uint i = 0; i < borders.length; ++i)
    {

void HandleViewportBorderDragEnd(StringHash eventType, VariantMap& eventData)
{
    // Sets the new viewports by checking all the dependencies
    Array<UIElement@> children = viewportUI.GetChildren();
    Array<BorderImage@> borders;

