Example #1
0
            static void DrawLineEndAtIter(Cairo.Context cntx, TextView view, TextIter iter)
            {
                Gdk.Rectangle rect = view.GetIterLocation(iter);
                int           x, y;

                view.BufferToWindowCoords(TextWindowType.Text,
                                          rect.X,
                                          rect.Y + rect.Height / 2,
                                          out x, out y);
                cntx.Save();
                cntx.Color = GetDrawingColorForIter(view, iter);

                double arrowSize = 3;

                cntx.MoveTo(x + 10, y);
                cntx.RelLineTo(new Cairo.Distance(0, -arrowSize));
                cntx.RelMoveTo(new Cairo.Distance(0, arrowSize));
                cntx.RelLineTo(new Cairo.Distance(-8, 0));
                cntx.RelLineTo(new Cairo.Distance(arrowSize, arrowSize));
                cntx.RelMoveTo(new Cairo.Distance(-arrowSize, -arrowSize));
                cntx.RelLineTo(new Cairo.Distance(arrowSize, -arrowSize));

                cntx.Stroke();
                cntx.Restore();
            }
Example #2
0
            static void DrawSpaceAtIter(Cairo.Context cntx, TextView view, TextIter iter)
            {
                Gdk.Rectangle rect = view.GetIterLocation(iter);
                int           x, y;

                view.BufferToWindowCoords(TextWindowType.Text,
                                          rect.X + rect.Width / 2,
                                          rect.Y + rect.Height / 2,
                                          out x, out y);
                cntx.Save();
                cntx.Color = GetDrawingColorForIter(view, iter);
                //no overlap on the circle, even if context is set to LineCap.Square
                cntx.LineCap = Cairo.LineCap.Butt;

                cntx.MoveTo(x, y);
                cntx.Arc(x, y, 0.5, 0, 2 * Math.PI);

                cntx.Stroke();
                cntx.Restore();
            }