コード例 #1
0
 public void selectOnContained(VectorRect vr, APSelection sel)
 {
     if (_isNamed)
     {
         bool selected = false;
         foreach (RTIO io in connectedIOs)
         {
             if (!selected)
             {
                 Vector pstart, pstop, textpos, textdir;
                 getNamedPoints(io, out pstart, out pstop, out textpos, out textdir);
                 Vector vv = textpos +
                             Vector.V(textdir.y, -textdir.x) * owner.Font.Height * owner.scale;
                 VectorRect vx = VectorRect.containingThreePoints(pstart, pstop, vv);
                 if (owner.toScreen(vr).inside(vx))
                 {
                     selected = true;
                 }
             }
         }
         if (selected)
         {
             foreach (ProcessingConnection pc in connections)
             {
                 pc.selected = true;
             }
             sel.select(this);
         }
     }
     else
     {
         updateConnections();
         VectorRect v = owner.toScreen(vr);
         for (int i = 0; i < connections.Count; i++)
         {
             if (connections[i].bc.inside(v))
             {
                 sel.select(this, i);
             }
         }
     }
 }
コード例 #2
0
ファイル: RTForm.cs プロジェクト: 101010b/AudioProcessor2
        public void selectOnContained(VectorRect vr, APSelection sel)
        {
            VectorRect  rf;
            SystemPanel p = owner;

            if (p == null)
            {
                return;
            }
            if (_shrinked)
            {
                Vector dimS = Vector.V(_shrinkSize.Width, _shrinkSize.Height);
                rf = VectorRect.FromCenterSize(center, dimS);
            }
            else
            {
                rf = VectorRect.FromCenterSize(center, dim);
            }
            if (vr.inside(rf))
            {
                sel.select(this);
            }
        }