internal double GetFirstPositiveTiltedBorder(Border firstBorder) { LocationStatemachine.Machine m = LayoutManager.LocationMachine; double boxNewNextY = GetYPointTouchesBorder(m.CurrentBoxReference, typeof(FirstBorderPositive), firstBorder); //if (this.GetType() == typeof (DirectionL2R)) //{ // boxNewNextY = m.OriginY + LayoutManager.LocationMachine.NextRowStart + m.CurrentBoxToPlace.Height; //} //else //{ // boxNewNextY = m.OriginY + LayoutManager.LocationMachine.NextRowStart; //} LinearLine line = new LinearLine(firstBorder); return(line.GetXIntersect(boxNewNextY)); }
private bool IsHorizontalLineTouchBox(double newX, double newY, out double newXLocation) { LocationStatemachine.Machine mch = LayoutManager.LocationMachine; newXLocation = -1; foreach (Border b in LayoutManager.HorizontalY) { if (b.BoxWhichBelongTo != mch.boundingBox) { continue; } double minx = newX; double miny = newY; double maxx = minx + mch.CurrentBoxReference.Width; double maxy = miny + mch.CurrentBoxReference.Height; foreach (BorderNumberPair p in b.Endpoints) { // bnp = Utility.SortEndpointOrder(p); if (b.Coordinate <= maxy && b.Coordinate >= miny) { if ((p.coordinate1 >= minx && p.coordinate1 <= maxx) || (p.coordinate2 >= minx && p.coordinate2 <= maxx)) { if (b.Coordinate != miny && b.Coordinate != maxy) { newXLocation = p.coordinate2.Value; } } } } } if (newXLocation != -1) { return(true); } return(false); }
internal override bool IsHittingExteriorBorder(ColoBox boxToPlace, LocationStatemachine.Machine locationMachine) { return(boxToPlace.MinX < locationMachine.LastVerticalLine); }
internal override bool IsTouchingOriginLines(LocationStatemachine.Machine locationMachine, Border vx) { return(locationMachine.FirstVerticalLine == vx.Coordinate - locationMachine.CurrentBoxWidth); }
internal abstract bool IsHittingExteriorBorder(ColoBox boxToPlace, LocationStatemachine.Machine locationMachine);
internal abstract bool IsTouchingOriginLines(LocationStatemachine.Machine locationMachine, Border vx);