[Mono-bugs] [Bug 507458] New: Scrollable control does not draw content correctly when (sequence of) scaling transformation is used different than 1

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed May 27 09:31:52 EDT 2009


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


           Summary: Scrollable control does not draw content correctly
                    when (sequence of) scaling transformation is used
                    different than 1
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: All
        OS/Version: openSUSE 11.1
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Sys.Drawing.
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: mario.suric at yahoo.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.65 Safari/525.19

For small page based drawing a test application is made. The application draws
white pages in a ScrollableControl based window. Scrolling is working fine if
scaling transformation is 1. If the transformation is not 1, content is drawn
only partially. It is also interesting to observe that amount of drawn content
depends on position of horizontal scroll bar. If horizontal scroll bar is at
zero position, white paper is not drawn. If horizontal scroll bar is moved
slightly (just not zero) and then vertical scroll bar is moved, white paper is
visible. However, margins are still invisible. Please observe the cases using
attached source code and binaries. On Windows using MS .NET everything works
fine.

Also note that drawing is done in two phases:

//adjust to scroll positions
g.TranslateTransform(AutoScrollPosition.X, AutoScrollPosition.Y);            
g.ScaleTransform(zoom, zoom); 

//draw white paper 
g.FillRectangle(Brushes.White, whitePaperLeft, whitePaperTop, PAGE_WIDTH,
PAGE_HEIGHT);
//draw paper bounds
g.DrawRectangle(Pens.Black, whitePaperLeft, whitePaperTop, PAGE_WIDTH,
PAGE_HEIGHT);

//fillrectangle and rectangle is drawn only when zoom = 1 !!!

//if horizontal scroll bar is not at zero position fill rectangle is drawn!!!

//move orgin to the top left paper corner
g.TranslateTransform(whitePaperLeft, whitePaperTop);
//draw page content
drawPage(g, firstVisiblePage + i + 1);  //<- this part is always drawn
g.TranslateTransform(-whitePaperLeft, -whitePaperTop);

It looks like that sequential transformation1 - drawing1 - transformation2 -
drawing2 neglects drawing1. Drawing2 is always visible. Attached is the
complete code.

Reproducible: Always

Steps to Reproduce:
1. Start attached binaries (or recompile attached code)
2. Scroll vertically -- > everything is ok
3. Now change zoom using the zoom combo box. Set it to any value different to
100 %.
4. Scroll vertically -- > only part of the content is drawn.
5. Move horizontal scroll bar (just not to be at zero position) -> more details
are drawn. Almost everything. Only gray margin lines are missing.
Actual Results:  
Drawing in ScrollableControl should work with any transformation matrix.
Drawing content is dependent of horizontal scroll bar position and zoom level. 

Expected Results:  
Correct drawing for all values of scaling factor, and not only when scaling
factor is one.

-- 
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