@Override
    public void paintComponent(Graphics g)
    {
        super.paintComponent(g);

        if (rp == null && rp.getEntities() == null)
            return;

        double offsetX = 0;
        double offsetY = 0;
        double widthMultiplier = getWidth() / (double)Const.width;
        double heightMultiplier = getHeight() / (double)Const.height;
        
        if (rp.getSettings().hasAspectRatio())
        {
            offsetX = offsetXforAspectRatio(widthMultiplier, heightMultiplier);
            offsetY = offsetYforAspectRatio(widthMultiplier, heightMultiplier);

            widthMultiplier = Math.min(widthMultiplier, heightMultiplier);
            heightMultiplier = Math.min(widthMultiplier, heightMultiplier);
        }
        
        drawBackground(g, offsetX, offsetY, widthMultiplier, heightMultiplier);
        
        List<Positioned> drawables = rp.getEntities().getList(Positioned.class);
        for (Positioned p : drawables)
            p.draw(g, offsetX, offsetY, widthMultiplier, heightMultiplier);
    }