<commit_before>#include <fifechan/widgets/circularcontainer.hpp>
#include <cmath>

namespace fcn
{
    CircularContainer::CircularContainer(int radius, float spacing)
    :
    mRadius(radius),
    mSpacing(spacing),
    mUsedSlots(0)
    {
        int diameter = 2 * radius;
        
        setSize(diameter, diameter);
        
        calculateAvailableSlots();
    }
    
    CircularContainer::~CircularContainer()
    {
    }
    
    void CircularContainer::setRadius(int radius)
    {
        int diameter = 2 * radius;
        
        setSize(diameter, diameter);
        relayout();
    }
    
    void CircularContainer::widgetAdded(const ContainerEvent& containerEvent)
    {   
        AutoLayoutContainer::widgetAdded(containerEvent);  
        
        if(containerEvent.getContainer() == this)
        {
            Widget *added = containerEvent.getSource();
            
            layoutAddedChild(added);   
        }
    }
    
    void CircularContainer::widgetRemoved(const ContainerEvent& containerEvent)
    {
        AutoLayoutContainer::widgetRemoved(containerEvent);
        
        if(containerEvent.getContainer() == this)
        {
            if(!mQueuedWidgets.empty())
            {   
                relayout();
                <commit_msg>Fixed a relayouting issue in CircularContainer::widgetRemoved.<commit_after>#include <fifechan/widgets/circularcontainer.hpp>
#include <cmath>

namespace fcn
{
    CircularContainer::CircularContainer(int radius, float spacing)
    :
    mRadius(radius),
    mSpacing(spacing),
    mUsedSlots(0)
    {
        int diameter = 2 * radius;
        
        setSize(diameter, diameter);
        
        calculateAvailableSlots();
    }
    
    CircularContainer::~CircularContainer()
    {
    }
    
    void CircularContainer::setRadius(int radius)
    {
        int diameter = 2 * radius;
        
        setSize(diameter, diameter);
        relayout();
    }
    
    void CircularContainer::widgetAdded(const ContainerEvent& containerEvent)
    {   
        AutoLayoutContainer::widgetAdded(containerEvent);  
        
        if(containerEvent.getContainer() == this)
        {
            Widget *added = containerEvent.getSource();
            
            layoutAddedChild(added);   
        }
    }
    
    void CircularContainer::widgetRemoved(const ContainerEvent& containerEvent)
    {
        AutoLayoutContainer::widgetRemoved(containerEvent);
        
        if(containerEvent.getContainer() == this)
        {
            relayout();

            if(!mQueuedWidgets.empty())
            {   
{'fraction_non_alphanumeric': 0.09463113171108536, 'fraction_numerical': 0.002317497103128621, 'mean_word_length': 2.0870083432657927, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4420209', 'n_tokens_mistral': 711, 'n_tokens_neox': 697, 'n_words': 107}