Esempio n. 1
0
        private void C_MAIN_CANVAS_PointerMoved(object sender, PointerRoutedEventArgs e)
        {
            if (m_Pressed && m_ActiveElementType == ACTIVE_ELEMENT_TYPE.CANVAS)

            {
                var t = this.m_OldTranslation;



                t.X  = (float)(e.GetCurrentPoint(this).Position.X - m_OldPoint.X);
                t.X /= C_MAINSCROLLVIEWER.ZoomFactor;
                t.X  = -t.X + m_OldTranslation.X;

                t.Y  = (float)(e.GetCurrentPoint(this).Position.Y - m_OldPoint.Y);
                t.Y /= C_MAINSCROLLVIEWER.ZoomFactor;
                t.Y  = -t.Y + m_OldTranslation.Y;


                m_OldPoint       = e.GetCurrentPoint(this).Position;
                m_OldTranslation = t;


                C_MAINSCROLLVIEWER.ChangeView(m_OldTranslation.X, m_OldTranslation.Y, C_MAINSCROLLVIEWER.ZoomFactor);
            }
            if ((m_FromSlot == null && m_ToSlot != null) || (m_FromSlot != null && m_ToSlot == null))
            {
                m_TempPath.Data       = GenTempPathGeomentry(m_FromSlot, m_ToSlot, e.GetCurrentPoint(C_MAIN_CANVAS).Position);
                m_TempPath.Visibility = Visibility.Visible;
            }
            else
            {
                m_TempPath.Visibility = Visibility.Collapsed;
            }
        }
Esempio n. 2
0
        public void TS_FocusNode(String NodeName)
        {
            if (NodeName == null)
            {
                return;
            }
            if (!m_FunctionNodeModels.ContainsKey(NodeName))
            {
                return;
            }
            Model.TrickerStarFunctionNodeModel node_m = (Model.TrickerStarFunctionNodeModel)m_FunctionNodeModels[NodeName];
            TrickerStarFunctionNode            node_v = (TrickerStarFunctionNode)m_FunctionNodeViews[NodeName];


            Point offset = new Point(0, 0);

            offset.X = node_v.Translation.X - C_MAINSCROLLVIEWER.ActualWidth / 2;
            offset.Y = node_v.Translation.Y - C_MAINSCROLLVIEWER.ActualHeight / 2;
            C_MAINSCROLLVIEWER.ChangeView(offset.X, offset.Y, 1);
        }
Esempio n. 3
0
 public void TS_FocusPos(Point Pos)
 {
     C_MAINSCROLLVIEWER.ChangeView(Pos.X - C_MAINSCROLLVIEWER.ActualWidth / 2, Pos.Y - C_MAINSCROLLVIEWER.ActualHeight / 2, 1);
 }