[Mono-bugs] [Bug 515850] New: Applying transform to drawings works incorrectly when PageUnit != Pixel

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Jun 23 23:37:50 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=515850


           Summary: Applying transform to drawings works incorrectly when
                    PageUnit != Pixel
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: x86
        OS/Version: openSUSE 11.1
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Sys.Drawing.
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: amorozov at vtc.ru
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=299891)
 --> (http://bugzilla.novell.com/attachment.cgi?id=299891)
good and bad output in one pic

User-Agent:       Opera/9.64 (Windows NT 5.1; U; ru) Presto/2.1.1

Suppose below code is Form_Paint event handler

===

Graphics g = e.Graphics;
g.PageUnit = GraphicsUnit.Point;        // !!!

Pen pen = new Pen(Color.Black, 2);

for(int x = 0; x < 5; x++)
  for (int y = 0; y < 5; y++)
  {
    Matrix m = new Matrix(1, 0, 0, 1, x * 23, y * 23);

    g.Transform = m;

    g.DrawLine(pen, 5, 5, 25, 5); 
    g.DrawLine(pen, 25, 5, 25, 25); 
    g.DrawLine(pen, 25, 25, 5, 25); 
    g.DrawLine(pen, 5, 25, 5, 5);
  }

===



Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Actual Results:  
Output is ok when PageUnit = GraphicsUnit.Pixel and when PageUnit =
GraphicsUnit.Point then squares "overlapped".

Expected Results:  
Output produced is 5x5 squares. Squares should NOT overlap each other
regardless PageUnit.

Tested on 2.4 stable and 136748 SVN revision libgdiplus.

Seems that first point (x1, y1) DrawLine is transforming correctly but second
(x2, y2) is not.

Also fails if PageUnit = Milimiter or PageUnit = Inch.

Not sure but can corelate with Bug 392391.

-- 
Configure bugmail: http://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