Esempio n. 1
0
        private void InkCanvas_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            var position = e.GetPosition(_inkCanvas);

            if (selectedNode != null && RectHelper.Contains(selectedNode.BoundingRect, position))
            {
                ExpandSelection();
                lastDoubleTapTime = DateTime.Now;
            }
        }
Esempio n. 2
0
        private IInkAnalysisNode FindHitNodeByKind(Point position, InkAnalysisNodeKind kind)
        {
            var nodes = InkAnalyzer.AnalysisRoot.FindNodes(kind);

            foreach (var node in nodes)
            {
                if (RectHelper.Contains(node.BoundingRect, position))
                {
                    return(node);
                }
            }
            return(null);
        }
Esempio n. 3
0
        private InkAnalysisParagraph FindHitParagraph(Point pt)
        {
            var paragraphs = inkAnalyzer.AnalysisRoot.FindNodes(InkAnalysisNodeKind.Paragraph);

            foreach (var paragraph in paragraphs)
            {
                // To support ink written with angle, RotatedBoundingRect should be used in hit testing.
                if (RectHelper.Contains(paragraph.BoundingRect, pt))
                {
                    return((InkAnalysisParagraph)paragraph);
                }
            }
            return(null);
        }
Esempio n. 4
0
        private void InkCanvas_Tapped(object sender, TappedRoutedEventArgs e)
        {
            var position = e.GetPosition(_inkCanvas);

            if (selectedNode != null && RectHelper.Contains(selectedNode.BoundingRect, position))
            {
                if (DateTime.Now.Subtract(lastDoubleTapTime).TotalMilliseconds < TripleTapTime)
                {
                    ExpandSelection();
                }
            }
            else
            {
                selectedNode = _analyzer.FindHitNode(position);
                ShowOrHideSelection(selectedNode);
            }
        }
 public bool ContainsPosition(Point position)
 {
     return(!selectionStrokesRect.IsEmpty && RectHelper.Contains(selectionStrokesRect, position));
 }