public static GetUpperPoint ( Point points ) : Point | ||
points | Point | |
Результат | Point |
private void CalcLinkSize() { if (!needCalcLinkSize) { return; } Size sizeTmp = Size.Empty; if (lines.Length > 1) { Point[] points = new Point[lines.Length * 2]; int i = 0; foreach (LineElement ln in lines) { points[i] = ln.Point1; points[i + 1] = ln.Point2; i += 2; } Point upper = DiagramUtil.GetUpperPoint(points); Point lower = DiagramUtil.GetLowerPoint(points); sizeTmp = new Size(lower.X - upper.X, lower.Y - upper.Y); } size = sizeTmp; needCalcLinkSize = false; }
private void UpdateUpperSelectionPoint() { //Get upper selecion point Point[] points = new Point[document.SelectedElements.Count]; int p = 0; foreach (BaseElement el in document.SelectedElements) { points[p] = el.Location; p++; } upperSelPoint = DiagramUtil.GetUpperPoint(points); }
private void CalcLinkLocation() { //CalcLink(); if (!needCalcLinkLocation) { return; } Point[] points = new Point[lines.Length * 2]; int i = 0; foreach (LineElement ln in lines) { points[i] = ln.Point1; points[i + 1] = ln.Point2; i += 2; } location = DiagramUtil.GetUpperPoint(points); needCalcLinkLocation = false; }