<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FontEffectsLib.CoreTypes;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace FontEffectsLib.SpriteTypes
{
    public class GameSprite : BaseGameObject
    {
        protected Texture2D _texture;
        protected Rectangle? _sourceRectangle;

        public virtual Texture2D Texture
        {
            get { return _texture; }
            set { _texture = value; }
        }

        public Rectangle? SourceRectangle
        {
            get { return _sourceRectangle; }
            set { _sourceRectangle = value; }
        }
        

        public GameSprite(Texture2D texture, Vector2 position, Color tintColor)
            : base(position, tintColor)
        {
            _texture = texture;
            _sourceRectangle = null;
        }
        
        public override void SetCenterAsOrigin()
        {
            _origin = new Vector2(_texture.Width / 2, _texture.Height / 2) * _scale;
        }

        public override void Update(GameTime gameTime)
        {
            
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(_texture, _position, _sourceRectangle, _tintColor, _rotation, _origin, _scale, _effects, _layerDepth);
        }
    }<commit_msg>Fixed Origin Centering logic<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FontEffectsLib.CoreTypes;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace FontEffectsLib.SpriteTypes
{
    public class GameSprite : BaseGameObject
    {
        protected Texture2D _texture;
        protected Rectangle? _sourceRectangle;

        public virtual Texture2D Texture
        {
            get { return _texture; }
            set { _texture = value; }
        }

        public Rectangle? SourceRectangle
        {
            get { return _sourceRectangle; }
            set { _sourceRectangle = value; }
        }
        

        public GameSprite(Texture2D texture, Vector2 position, Color tintColor)
            : base(position, tintColor)
        {
            _texture = texture;
            _sourceRectangle = null;
        }
        
        public override void SetCenterAsOrigin()
        {
            _origin = new Vector2((float)_texture.Width / 2f, (float)_texture.Height / 2f);
        }

        public override void Update(GameTime gameTime)
        {
            
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(_texture, _position, _sourceRectangle, _tintColor, _rotation, _origin, _scale, _effects, _layerDepth);
        }
    }
{'fraction_non_alphanumeric': 0.07049891540130152, 'fraction_numerical': 0.005061460592913955, 'mean_word_length': 2.047356828193833, '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': '1872547', 'n_tokens_mistral': 741, 'n_tokens_neox': 731, 'n_words': 178}