Exemplo n.º 1
0
        protected internal override void OnXYUpdated()
        {
            if (mConnection == null)
            {
                return;
            }

            // Remove it from its old location in the database (if already present)
            if (mConnection.InDB)
            {
                mConnection.DB.RemoveConnection(mConnection);
            }

            //update Connection's location for connection search
            Vector2 relative = BlocklyUI.WorkspaceView.CodingArea.InverseTransformPoint(ViewTransform.position);

            mConnection.Location.x = (int)relative.x;
            mConnection.Location.y = (int)relative.y;

            // Insert it into its new location in the database.
            if (!mConnection.Hidden)
            {
                mConnection.DB.AddConnection(mConnection);
            }

            // update target block view's
            if (mTargetBlockView != null)
            {
                mTargetBlockView.OnXYUpdated();
            }
        }