patchDotGNU Portable.NET - Patches: patch #3714, Fix layouting bug in Control.cs

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #3714: Fix layouting bug in Control.cs

Submitter:  Marc Haisenko <darkdust>
Submitted:  Wed 02 Feb 2005 12:53:37 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  darkdust Open/Closed:  Closed

Tue 08 Feb 2005 09:49:21 AM UTC, comment #1: 

Applied to CVS on 08. Feb 2005 (Control.cs 1.85)

Marc Haisenko <darkdust>
Group Member
Wed 02 Feb 2005 12:53:37 PM UTC, original submission:  

The layouting (namely the anchor layouting) code in Control.cs needs to know the last size of the parent when layouting the children.

This information was stored in the children in prevParentWidth and prevParentHeight. This could cause a bug in which the anchoring layouting was done wrong and the child got a wrong size. Unfortunately I haven't been able to write a sample application that demonstrates this bug, but it appeared in the Trumpf prototype.

The following patch fixes this issue by doing the bookkeeping in the parent, not the children (this means the old size is stored only once, in the parent, instead of several times, in the children). The prevParentWidth and prevParentHeight members are deleted, instead prev{Left,Top,Width,Height} are introduced which are updated by the UpdateBounds method.

This is similar to the way Mono does it.

Furthermore this patch also does a little refactoring/optimization of the PerformActualLayout method: currently it iterates over all children two times, the first time to do the dock layouting and a second time to do the anchor layouting. This is unneccessary, the patch changes this so only one iteration takes place.

The patch also moves the anchor layouting code in a separate method PerformAnchorLayout, which should improve maintainability.

Marc Haisenko <darkdust>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #8358:  Control.cs.patch added by darkdust (8KiB - text/x-diff - Fixes layouting bug and does minor refactoring)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-02-08 darkdust StatusNone Done
    Assigned toNone darkdust
    Open/ClosedOpen Closed
2005-02-02 darkdust Attached File- Added Control.cs.patch, #4134

Back to the top

Powered by Savane 3.13-4b48.
Corresponding source code