private void drawLegend() {
		window.setView(window.getDefaultView());
		window.draw(legendBar);
		
		int lastAuthor = allAuthors.size() - 1;
		int i = 0;
		window.setView(legendView);
		for (Map.Entry<String, Author> entry: allAuthors.entrySet()) {
			Author author = entry.getValue();
			float y = author.getAuthorSprite().getPosition().y;
			
			if (i == lastAuthor && y < legendView.getSize().y) {
				legendView.setCenter(window.getDefaultView().getCenter());
			} else {
			
				if (i == 0 && y > legendView.getCenter().y - legendView.getSize().y/2 + 10) {
					legendView.setCenter(window.getDefaultView().getCenter());
				}
				
				float spriteHeight = author.getAuthorSprite().getLocalBounds().height;
				float textHeight = author.getAuthorNameText().getLocalBounds().height;
				
				if (i == lastAuthor && y + spriteHeight + textHeight + 10 < legendView.getCenter().y + legendView.getSize().y/2) {
					legendView.setCenter(legendView.getCenter().x, y + spriteHeight + textHeight + 10 - legendView.getSize().y/2);
				}
			}
			
			window.draw(entry.getValue());
			i++;
		}
		
		window.setView(currentView);
	}