<commit_before>package com.mygdx.game;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;

public class MyGdxGame extends ApplicationAdapter {
	private SpriteBatch batch;
	private Texture img;
	private Sprite sprite;

	@Override
	public void create() {
		batch = new SpriteBatch();
		img = new Texture("images/blue_sun_1.jpg");
		sprite = new Sprite(img);
	}

	@Override
	public void render() {
		// Makes the background blue.
		Gdx.gl.glClearColor(0, 0, 1, 1);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);


		int windowWidth = Gdx.graphics.getWidth();
		int windowHeight = Gdx.graphics.getHeight();
		
		// Size of the sprite should be 80% of the screen width.
		float spriteWidth = windowWidth * 0.8f;
		float spriteHeight = windowHeight * 0.8f;
		// Bottom-left corner of the sprite... Sprite should be centered.
		float x = windowWidth * 0.1f;
		float y = windowHeight * 0.1f;

		// Update the sprite's "camera" to adjust for the current screen size.
		batch.getProjectionMatrix().setToOrtho2D(0f, 0f, windowWidth,
				windowHeight);

		// Update the sprite.
		batch.begin();
		sprite.setBounds(x, y, spriteWidth, spriteHeight);
		sprite.draw(batch);
		batch.end();
		
		return;
	}
}
<commit_msg>Playing around with the sprite size to keep it correctly proportioned.<commit_after>package com.mygdx.game;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;

public class MyGdxGame extends ApplicationAdapter {
	private SpriteBatch batch;
	private Texture img;
	private Sprite sprite;

	@Override
	public void create() {
		batch = new SpriteBatch();
		img = new Texture("images/blue_sun_1.jpg");
		sprite = new Sprite(img);
	}

	@Override
	public void render() {
		// Makes the background blue.
		Gdx.gl.glClearColor(0, 0, 1, 1);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

		resizeSprite();

		return;
	}
	
	private void resizeSprite() {
		// Size the sprite to 80% of the smaller of window width or height.
		final int windowWidth = Gdx.graphics.getWidth();
		final int windowHeight = Gdx.graphics.getHeight();
		float spriteSize = windowWidth < windowHeight ? windowWidth : windowHeight;
		spriteSize *= 0.8;
		// Get the location of the bottom-left corner of the sprite.
		final float x = (windowWidth - spriteSize) * 0.5f;
		final float y = (windowHeight - spriteSize) * 0.5f;

		// Update the sprite's "camera" to adjust for the current screen size.
		batch.getProjectionMatrix().setToOrtho2D(0f, 0f, windowWidth, windowHeight);

		// Update the sprite.
		batch.begin();
		sprite.setBounds(x, y, spriteSize, spriteSize);
		sprite.draw(batch);
		batch.end();
		
		return;
	}
}

{'fraction_non_alphanumeric': 0.1130114017437961, 'fraction_numerical': 0.015425888665325285, 'mean_word_length': 4.00503355704698, 'pattern_counts': {'":': 0, '<': 4, '<?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': '3101681', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1001, 'n_words': 268}