コード例 #1
0
        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));
        }
コード例 #2
0
ファイル: DirectionL2R.cs プロジェクト: 15831944/C--Projects
        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);
        }
コード例 #3
0
ファイル: DirectionR2L.cs プロジェクト: 15831944/C--Projects
 internal override bool IsHittingExteriorBorder(ColoBox boxToPlace, LocationStatemachine.Machine locationMachine)
 {
     return(boxToPlace.MinX < locationMachine.LastVerticalLine);
 }
コード例 #4
0
ファイル: DirectionR2L.cs プロジェクト: 15831944/C--Projects
 internal override bool IsTouchingOriginLines(LocationStatemachine.Machine locationMachine, Border vx)
 {
     return(locationMachine.FirstVerticalLine == vx.Coordinate - locationMachine.CurrentBoxWidth);
 }
コード例 #5
0
 internal abstract bool IsHittingExteriorBorder(ColoBox boxToPlace, LocationStatemachine.Machine locationMachine);
コード例 #6
0
 internal abstract bool IsTouchingOriginLines(LocationStatemachine.Machine locationMachine, Border vx);