Canvas/DrawTools/LineTool.cs

(开头部分) 13KB

这里只显示每个文件的开头 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.DrawTools
{
	class NodePointLine : INodePoint
	{
		public enum ePoint
		{
			P1,
			P2,
		}
		static bool m_angleLocked = false;
		Line m_owner;
		Line m_clone;
		UnitPoint m_originalPoint;
		UnitPoint m_endPoint;
		ePoint m_pointId;
		public NodePointLine(Line owner, ePoint id)
		{
			m_owner = owner;
			m_clone = m_owner.Clone() as Line;
			m_pointId = id;
			m_originalPoint = GetPoint(m_pointId);
		}
		#region INodePoint Members
		public IDrawObject GetClone()
		{
			return m_clone;
		}
		public IDrawObject GetOriginal()
		{
			return m_owner;
		}
		public void SetPosition(UnitPoint pos)
		{
			if (Control.ModifierKeys == Keys.Control)
				pos = HitUtil.OrthoPointD(OtherPoint(m_pointId), pos, 45);
			if (m_angleLocked || Control.ModifierKeys == (Keys)(Keys.Control | Keys.Shift))
				pos = HitUtil.NearestPointOnLine(m_owner.P1, m_owner.P2, pos, true);
			SetPoint(m_pointId, pos, m_clone);
		}
		public void Finish()
		{
			m_endPoint = GetPoint(m_pointId);
			m_owner.P1 = m_clone.P1;
			m_owner.P2 = m_clone.P2;
			m_clone = null;
		}
		public void Cancel()
		{
		}
		public void Undo()
		{
			SetPoint(m_pointId, m_originalPoint, m_owner);
后面还有 425 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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