<commit_before>﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace Evbpc.Framework.Drawing
{
    [Serializable]
    [StructLayout(LayoutKind.Explicit)]
    public struct PointF
    {
        [FieldOffset(0)]
        private ulong _packedValue;
        [FieldOffset(0)]
        private float _x;
        [FieldOffset(4)]
        private float _y;

        public PointF(float x, float y)
            : this()
        {
            _x = x;
            _y = y;
        }

        [Browsable(false)]
        public bool IsEmpty { get { return this == Empty; } }

        public float X { get { return _x; } set { _x = value; } }
        public float Y { get { return _y; } set { _y = value; } }

        public static PointF Add(PointF pt, Size sz)
        {
            return pt + sz;
        }

        public static PointF Add(PointF pt, SizeF sz)
        {
            return pt + sz;
        }

        public override bool Equals(Object obj)
        {
            if (obj is PointF)
                return (PointF)obj == this;

            return false;
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public static PointF Subtract(PointF pt, Size sz)
        {
            return pt - sz;
        }

        public static PointF Subtract(PointF pt, SizeF sz)
        {
            return pt - sz;
        }

        public override string ToString()
        {
            return $"({_x},{_y})";
        }

        public static PointF operator +(PointF pt, Size sz)
        {
            return new PointF(pt.X + sz.Width, pt.Y + sz.Height);
        }
        
        public static PointF operator +(PointF pt, SizeF sz)<commit_msg>Implemented `GetHashCode()` for `PointF` in the same manner as `Vector2.GetHashCode()`.<commit_after>﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace Evbpc.Framework.Drawing
{
    [Serializable]
    [StructLayout(LayoutKind.Explicit)]
    public struct PointF
    {
        [FieldOffset(0)]
        private ulong _packedValue;
        [FieldOffset(0)]
        private float _x;
        [FieldOffset(4)]
        private float _y;

        public PointF(float x, float y)
            : this()
        {
            _x = x;
            _y = y;
        }

        [Browsable(false)]
        public bool IsEmpty { get { return this == Empty; } }

        public float X { get { return _x; } set { _x = value; } }
        public float Y { get { return _y; } set { _y = value; } }

        public static PointF Add(PointF pt, Size sz)
        {
            return pt + sz;
        }

        public static PointF Add(PointF pt, SizeF sz)
        {
            return pt + sz;
        }

        public override bool Equals(Object obj)
        {
            if (obj is PointF)
                return (PointF)obj == this;

            return false;
        }

        public override int GetHashCode()
        {
            int hash = 17;

            unchecked
            {
                hash = hash * 23 + _x.GetHashCode();
                hash = hash * 23 + _y.GetHashCode();
            }

            return hash;
        }

        public static PointF Subtract(PointF pt, Size sz)
        {
            return pt - sz;
        }

        public static PointF Subtract(PointF pt, SizeF sz)
        {
            return pt - sz;
        }

        public override string ToString()
        {
            return $"({_x},{_y})";
        }

        public static PointF operator +(PointF pt, Size sz)
        {
            return new PointF(pt.X + sz.Width, pt.Y + sz.Height);
        }
        
        public static PointF operator +(PointF pt, SizeF sz)
{'fraction_non_alphanumeric': 0.09277820611667952, 'fraction_numerical': 0.003341043433564636, 'mean_word_length': 1.494871794871795, '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': '798153', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1097, 'n_words': 330}