<commit_before>package net.mostlyoriginal.game.component;

import com.artemis.Component;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.math.Rectangle;
import net.mostlyoriginal.game.Path;
import net.mostlyoriginal.game.manager.LayerManager;
import org.xguzm.pathfinding.grid.GridCell;

import java.util.List;

/**
 * Bitmap layer.
 */
public class Layer extends Component {

	public Pixmap pixmap;

	public Layer() {
		pixmap = new Pixmap(LayerManager.LAYER_WIDTH, LayerManager.LAYER_HEIGHT, Pixmap.Format.RGBA8888);
	}

	public void drawPixel(int x, int y, Color color) {
		pixmap.setColor(color);
		pixmap.drawPixel(x, y);
	}

	public void drawPixmapToFit(Pixmap source) {

		float aspectRatio = source.getWidth() / source.getHeight();

		// bind pixmap to window.
		Rectangle dest = new Rectangle(0, 0, source.getWidth(), source.getHeight())
				.fitInside(new Rectangle(0, 0, pixmap.getWidth(), pixmap.getHeight()));

		pixmap.drawPixmap(source,
				0, 0, source.getWidth(), source.getHeight(),
				0, 0, (int) dest.width, (int) dest.height);<commit_msg>Make sure the map doesn't overlap the menu and title.<commit_after>package net.mostlyoriginal.game.component;

import com.artemis.Component;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.math.Rectangle;
import net.mostlyoriginal.game.Path;
import net.mostlyoriginal.game.manager.LayerManager;
import org.xguzm.pathfinding.grid.GridCell;

import java.util.List;

/**
 * Bitmap layer.
 */
public class Layer extends Component {

	public Pixmap pixmap;

	public Layer() {
		pixmap = new Pixmap(LayerManager.LAYER_WIDTH, LayerManager.LAYER_HEIGHT, Pixmap.Format.RGBA8888);
	}

	public void drawPixel(int x, int y, Color color) {
		pixmap.setColor(color);
		pixmap.drawPixel(x, y);
	}

	public void drawPixmapToFit(Pixmap source) {

		float aspectRatio = source.getWidth() / source.getHeight();

		int paddingTop = 50;
		int paddingBottom = 50;

		// bind pixmap to window.
		Rectangle dest = new Rectangle(0, 0, source.getWidth(), source.getHeight())
				.fitInside(new Rectangle(0, paddingTop, pixmap.getWidth(), pixmap.getHeight()-paddingBottom-paddingTop));

		pixmap.drawPixmap(source,
				0, 0, source.getWidth(), source.getHeight(),
				(int)dest.x, (int)dest.y, (int) dest.width, (int) dest.height);
{'fraction_non_alphanumeric': 0.12835093419983754, 'fraction_numerical': 0.010154346060113728, 'mean_word_length': 4.78169014084507, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3430403', 'n_tokens_mistral': 933, 'n_tokens_neox': 816, 'n_words': 180}