示例#1
0
        public static void DrawCurve(MatrixGenerators.Curve200 gen)
        {
            using (Cell.LinePx(GeneratorDraw.nodeWidth))             //square cell
            //using (Timer.Start("DrawCurve"))
            {
                Draw.Rect(new Color(1, 1, 1, 0.5f));              //background

                using (Cell.Padded(5))
                    CurveDraw.DrawCurve(gen.curve, gen.histogram);
            }
        }
示例#2
0
        private static Curve draggedCurve;         //curve currently dragging, a backup without a node removed. Presuming we can drag only one object only one instance exists


        public static void DrawCurve(Curve curve, float[] histogram)
        {
            if (!UI.current.layout && !(UI.current.optimizeElements && !UI.current.IsInWindow()))
            {
                if (histogram != null)
                {
                    Material histogramMat = UI.current.textures.GetMaterial("Hidden/DPLayout/Histogram");
                    histogramMat.SetFloatArray("_Histogram", histogram);
                    histogramMat.SetVector("_Backcolor", new Vector4(0, 0, 0, 0));
                    histogramMat.SetVector("_Forecolor", new Vector4(0, 0, 0, 0.25f));
                    Draw.Texture(null, histogramMat);
                }

                Draw.Grid(new Color(0, 0, 0, 0.4f));              //background grid
            }

            if (UI.current.scrollZoom.zoom > 0.75f)
            {
                CurveDraw.DragCurve(curve);
            }
            CurveDraw.DisplayCurve(curve);
        }