Exemplo n.º 1
0
        /// <summary>
        /// Checks whether the given position is inside the slider part or not.
        /// </summary>
        /// <param name="position">The checked position in the local coordinate system of this UISlider control.</param>
        /// <returns>True if the checked position is inside the slider part, false otherwise.</returns>
        private bool IsInsideSlider(RCIntVector position)
        {
            RCIntVector    posInTrackSpace    = position - this.trackPosition;
            RCIntRectangle sliderInTrackSpace = this.sliderRectangle
                                                + (this.alignment == Alignment.Horizontal ?
                                                   new RCIntVector(this.sliderPosition, 0) :
                                                   new RCIntVector(0, this.sliderPosition));

            return(sliderInTrackSpace.Contains(posInTrackSpace));
        }
Exemplo n.º 2
0
 /// <summary>
 /// The method that actually implements the iteration strategy.
 /// </summary>
 private IEnumerator<ICell> GetEnumeratorImpl()
 {
     RCIntRectangle mapRect = new RCIntRectangle(new RCIntVector(0, 0), this.map.CellSize);
     foreach (ScanOperation scanOp in this.ScanOperations)
     {
         foreach (RCIntVector cellCoords in scanOp.ScanMethod(scanOp.AffectedArea))
         {
             if (mapRect.Contains(cellCoords))
             {
                 yield return this.map.GetCell(cellCoords);
             }
         }
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Internal method for checking the containment relationships between range, clip and cloak.
 /// </summary>
 /// <param name="container">Reference to the rectangle that must be the container.</param>
 /// <param name="content">Reference to the rectangle that must be the content.</param>
 /// <returns>True if the containment relationships are OK.</returns>
 private bool CheckRectangles(ref RCIntRectangle container, ref RCIntRectangle content)
 {
     return((container != RCIntRectangle.Undefined) &&
            ((content == RCIntRectangle.Undefined) || (container.Contains(content))));
 }