// Token: 0x060001C8 RID: 456 RVA: 0x00010CBC File Offset: 0x0000EEBC
 public void drawlineGL(MyVector totalLine)
 {
     this.lineMaterial.SetPass(0);
     GL.PushMatrix();
     GL.Begin(1);
     for (int i = 0; i < totalLine.size(); i++)
     {
         mLine mLine = (mLine)totalLine.elementAt(i);
         GL.Color(new Color(mLine.r, mLine.g, mLine.b, mLine.a));
         int num  = mLine.x1 * mGraphics.zoomLevel;
         int num2 = mLine.y1 * mGraphics.zoomLevel;
         int num3 = mLine.x2 * mGraphics.zoomLevel;
         int num4 = mLine.y2 * mGraphics.zoomLevel;
         if (this.isTranslate)
         {
             num  += this.translateX;
             num2 += this.translateY;
             num3 += this.translateX;
             num4 += this.translateY;
         }
         for (int j = 0; j < mGraphics.zoomLevel; j++)
         {
             GL.Vertex(new Vector2((float)(num + j), (float)(num2 + j)));
             GL.Vertex(new Vector2((float)(num3 + j), (float)(num4 + j)));
             if (j > 0)
             {
                 GL.Vertex(new Vector2((float)(num + j), (float)num2));
                 GL.Vertex(new Vector2((float)(num3 + j), (float)num4));
                 GL.Vertex(new Vector2((float)num, (float)(num2 + j)));
                 GL.Vertex(new Vector2((float)num3, (float)(num4 + j)));
             }
         }
     }
     GL.End();
     GL.PopMatrix();
     totalLine.removeAllElements();
 }
Beispiel #2
0
        //---
        protected void addInsertItem(int ind)
        {
            Item ob = new Item();
            int  sw = comboBoxItems.SelectedIndex;

            switch (sw)
            {
            case 0:
                ob = new point();
                break;

            case 1:
                ob = new mLine();
                break;

            case 2:
                ob = new circle();
                break;

            case 3:
                ob = new ellipse();
                break;

            case 4:
                ob = new triangle();
                break;

            case 5:
                ob = new rectangle();
                break;

            case 6:
                ob = new roundRect();
                break;

            case 7:
                ob = new polygon();
                break;

            case 8:
                ob = new arc();
                break;

            case 9:
                ob = new color();
                break;

            default:

                break;
            }

            if (ind < 0)
            {
                if (listBoxIcons.SelectedIndex < 0)
                {
                    return;
                }
                icons[listBoxIcons.SelectedIndex].add(ob);
                listBoxItems.SelectedIndex = listBoxItems.Items.Count - 1;
            }
            else
            {
                icons[listBoxIcons.SelectedIndex].insert(ind, ob);
                listBoxItems.SelectedIndex = ind;
            }
        }