Canvas/Utils/Utils.cs

(开头部分) 26KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using System.Xml;

namespace Canvas
{
	public struct UnitPoint
	{
		public static UnitPoint Empty;
		public static bool operator !=(UnitPoint left, UnitPoint right)
		{
			return !(left == right);
		}
		public static bool operator ==(UnitPoint left, UnitPoint right)
		{
			if (left.X == right.X)
				return left.Y == right.Y;
			if (left.IsEmpty && right.IsEmpty) // after changing Empty to use NaN this extra check is required
				return true;
			return false;
		}
		public static UnitPoint operator + (UnitPoint left, UnitPoint right)
		{
			left.X += right.X;
			left.Y += right.Y;
			return left;
		}
		double m_x;
		double m_y;
		static UnitPoint()
		{
			Empty = new UnitPoint();
			Empty.m_x = double.NaN;
			Empty.m_y = double.NaN;
		}
		public UnitPoint(double x, double y)
		{
			m_x = x;
			m_y = y;
		}
		public UnitPoint(PointF p)
		{
			m_x = p.X;
			m_y = p.Y;
		}
		public bool IsEmpty
		{
			get 
			{
				return double.IsNaN(X) && double.IsNaN(Y);
			}
		}
		public double X
		{
			get { return m_x; }
			set { m_x = value; }
后面还有 796 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。