[Mono-bugs] [Bug 325502] GraphicsPath.IsVisible does not hit test shapes properly.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Oct 30 14:09:25 EDT 2007


https://bugzilla.novell.com/show_bug.cgi?id=325502#c2


Sebastien Pouliot <spouliot at novell.com> changed:

           What    |Removed                                         |Added
----------------------------------------------------------------------------
             Status|NEW                                             |RESOLVED
         Resolution|                                                |FIXED




--- Comment #2 from Sebastien Pouliot <spouliot at novell.com>  2007-10-30 12:09:25 MST ---
Fixed in SVN r88483.
Added unit tests in SVN r88484.

Funnier test case...

using System;
using System.Drawing;
using System.Drawing.Drawing2D;

class Program {

        static void Main (string[] args)
        {
                Pen pen = null;
                Graphics gr = null;

                using (GraphicsPath path = new GraphicsPath ()) {
                        foreach (string option in args) {
                                switch (option.ToLower ()) {
                                case "ellipse":
                                        path.AddEllipse (new Rectangle (20, 20,
50, 50));
                                        break;
                                case "pie":
                                        path.AddPie (new Rectangle (20, 20, 50,
50), 10, 320);
                                        break;
                                case "rectangle":
                                        path.AddRectangle (new Rectangle (20,
20, 50, 50));
                                        break;
                                case "outline":
                                        pen = new Pen (Color.Blue, 2);
                                        break;
                                case "graphics":
                                        gr = Graphics.FromImage (new Bitmap
(80, 80));
                                        break;
                                default:
                                        Console.WriteLine ("Unknown '{0}'
option.", option);
                                        return;
                                }
                        }

                        for (int y=0; y < 80; y++) {
                                for (int x=0; x < 80; x++) {
                                        if (pen == null)
                                                Console.Write (path.IsVisible
(x, y, gr) ? "X" : " ");
                                        else
                                                Console.Write
(path.IsOutlineVisible (x, y, pen, gr) ? "X" : " ");
                                }
                                Console.WriteLine (".");
                        }
                }
        }
}


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list