Example #1
0
        void DrawTimeNodes(Gdk.Window win)
        {
            bool hasSelectedTimeNode = false;

            using (Cairo.Context g = Gdk.CairoHelper.Create(win)) {
                int height;
                int width;

                win.Resize((int)(frames / pixelRatio), Allocation.Height);
                win.GetSize(out width, out height);

                g.Operator = Operator.Over;

                foreach (T tn in list)
                {
                    if (!tn.Equals(selected))
                    {
                        Cairo.Color borderColor = new Cairo.Color(color.R + 0.1, color.G + 0.1, color.B + 0.1, 1);
                        CairoUtils.DrawRoundedRectangle(g, tn.StartFrame / pixelRatio, 3,
                                                        tn.TotalFrames / pixelRatio, height - 6,
                                                        SECTION_HEIGHT / 7, color, borderColor);
                    }
                    else
                    {
                        hasSelectedTimeNode = true;
                    }
                }
                //Then we draw the selected TimeNode over the others
                if (hasSelectedTimeNode)
                {
                    Cairo.Color borderColor = new Cairo.Color(0, 0, 0, 1);
                    CairoUtils.DrawRoundedRectangle(g, selected.StartFrame / pixelRatio, 3,
                                                    selected.TotalFrames / pixelRatio, height - 6,
                                                    SECTION_HEIGHT / 7, color, borderColor);
                    if (selected.HasDrawings)
                    {
                        g.MoveTo(selected.KeyFrame / pixelRatio, 3);
                        g.LineTo(selected.KeyFrame / pixelRatio, SECTION_HEIGHT - 3);
                        g.StrokePreserve();
                    }
                }
                DrawLines(win, g, height, width);
            }
        }
Example #2
0
        protected override bool OnExposeEvent(EventExpose evnt)
        {
            int height;
            int width;

            Gdk.Window win = evnt.Window;

            win.GetSize(out width, out height);
            win.Resize((int)(frames / pixelRatio), height);
            win.GetSize(out width, out height);

            if (Environment.OSVersion.Platform == PlatformID.Unix)
            {
                this.CairoDraw(evnt, height, width);
            }
            else
            {
                this.GdkDraw(evnt, height, width);
            }
            return(base.OnExposeEvent(evnt));
        }