CGRect AddPointsOfType(PointType type, UITouch[] touches, Line line, CGRect rect)
        {
            var accumulatedRect = CGRect.Empty;

            for (int i = 0; i < touches.Length; i++)
            {
                var  touch    = touches [i];
                bool isStylus = touch.Type == UITouchType.Stylus;

                // The visualization displays non-`.Stylus` touches differently.
                if (!isStylus)
                {
                    type = type.Add(PointType.Finger);
                }

                if (isTouchUpdatingEnabled && (touch.EstimatedProperties != 0))
                {
                    type = type.Add(PointType.NeedsUpdate);
                }

                bool isLast = i == touches.Length - 1;
                if (type.Has(PointType.Coalesced) && isLast)
                {
                    type = type.Remove(PointType.Coalesced);
                    type = type.Add(PointType.Standard);
                }

                var touchRect = line.AddPointOfType(type, touch);
                accumulatedRect = accumulatedRect.UnionWith(touchRect);
                CommitLine(line);
            }

            return(rect.UnionWith(accumulatedRect));
        }
Example #2
0
		CGRect AddPointsOfType (PointType type, UITouch[] touches, Line line, CGRect rect)
		{
			var accumulatedRect = CGRect.Empty;

			for (int i = 0; i < touches.Length; i++) {
				var touch = touches [i];
				bool isStylus = touch.Type == UITouchType.Stylus;

				// The visualization displays non-`.Stylus` touches differently.
				if (!isStylus)
					type = type.Add (PointType.Finger);

				if (isTouchUpdatingEnabled && (touch.EstimatedProperties != 0))
					type = type.Add (PointType.NeedsUpdate);

				bool isLast = i == touches.Length - 1;
				if (type.Has (PointType.Coalesced) && isLast) {
					type = type.Remove (PointType.Coalesced);
					type = type.Add (PointType.Standard);
				}

				var touchRect = line.AddPointOfType (type, touch);
				accumulatedRect = accumulatedRect.UnionWith (touchRect);
				CommitLine (line);
			}

			return rect.UnionWith (accumulatedRect);
		}