Blame mono/Assistance/Canvas.cs
|
|
ebcc4f |
using System;
|
|
|
ebcc4f |
using System.Drawing;
|
|
|
ebcc4f |
using System.Drawing.Imaging;
|
|
|
ebcc4f |
using System.Collections.Generic;
|
|
|
ebcc4f |
using System.Linq;
|
|
|
ebcc4f |
|
|
|
ebcc4f |
namespace Assistance {
|
|
|
ebcc4f |
public class Canvas {
|
|
|
ebcc4f |
public readonly List<assistant> assistants = new List<assistant>();</assistant></assistant>
|
|
|
ebcc4f |
public readonly List<activepoint> points = new List<activepoint>();</activepoint></activepoint>
|
|
|
ebcc4f |
|
|
|
ebcc4f |
public ActivePoint ActivePoint = null;
|
|
|
ebcc4f |
|
|
|
ebcc4f |
public ActivePoint findPoint(Point position) {
|
|
|
ebcc4f |
foreach(ActivePoint point in points.Reverse<activepoint>())</activepoint>
|
|
|
ebcc4f |
if (point.isInside(position))
|
|
|
ebcc4f |
return point;
|
|
|
ebcc4f |
return null;
|
|
|
ebcc4f |
}
|
|
|
ebcc4f |
|
|
|
ebcc4f |
public void drawGuidlines(Graphics g, Point point) {
|
|
|
ebcc4f |
foreach(Assistant assistant in assistants)
|
|
|
ebcc4f |
assistant.drawGuidlines(g, point);
|
|
|
ebcc4f |
}
|
|
|
ebcc4f |
|
|
|
ebcc4f |
public void drawAssistants(Graphics g) {
|
|
|
ebcc4f |
foreach(Assistant assistant in assistants)
|
|
|
ebcc4f |
assistant.draw(g);
|
|
|
ebcc4f |
}
|
|
|
ebcc4f |
|
|
|
ebcc4f |
public void drawPoints(Graphics g, ActivePoint activePoint) {
|
|
|
ebcc4f |
foreach(ActivePoint point in points)
|
|
|
ebcc4f |
point.draw(g, activePoint == point ? ActivePoint.Mode.Active : ActivePoint.Mode.Common);
|
|
|
ebcc4f |
}
|
|
|
ebcc4f |
|
|
|
ebcc4f |
public void draw(Graphics g, ActivePoint activePoint, Point guidlinesPoint) {
|
|
|
ebcc4f |
drawGuidlines(g, guidlinesPoint);
|
|
|
ebcc4f |
drawAssistants(g);
|
|
|
ebcc4f |
drawPoints(g, activePoint);
|
|
|
ebcc4f |
}
|
|
|
ebcc4f |
|
|
|
ebcc4f |
public void draw(Graphics g, ActivePoint activePoint) {
|
|
|
ebcc4f |
drawAssistants(g);
|
|
|
ebcc4f |
drawPoints(g, activePoint);
|
|
|
ebcc4f |
}
|
|
|
ebcc4f |
}
|
|
|
ebcc4f |
}
|
|
|
ebcc4f |
|