FS#2813 - Don't treat empty widgets as false positive in CompareWidgetArrays()

Attached to Project: OpenTTD
Opened by S├ębastien Brissaud (sbr) - Sunday, 05 April 2009, 20:44 GMT
Last edited by Remko Bijker (Rubidium) - Sunday, 15 November 2009, 10:38 GMT
Type Bug
Category Interface
Status Closed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version 1.0.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


This patch avoid CompareWidgetArrays() to report empty widget as false positive.

In the original format, empty widget are coded with left == right == top == bottom == 0.
In the nested widgets format, they are defined with SetMinimalSize(0, 0). Converted to the original format, this widget has left == right + 1 and inherit container's top and bottom.
The original widget and the converted nested one thus differ in their definition and are catched by CompareWidgetArrays().
This task depends upon

Closed by  Remko Bijker (Rubidium)
Sunday, 15 November 2009, 10:38 GMT
Reason for closing:  Out of date
Additional comments about closing:  Since CompareWidgetArrays has been removed in r18088.
Comment by Alberth (Alberth) - Wednesday, 08 April 2009, 19:00 GMT
Not all WWT_EMPTY widgets have their top-left corner at (0, 0), and size (1, 1).

Rather than sweeping differences under the carpet, a better approach may be to eliminate such widgets (which is what nested widgets aim to do).
CompareWidgetArrays() is just a step towards that goal.

Edit: Clarified last statements.
Comment by Remko Bijker (Rubidium) - Monday, 13 July 2009, 16:17 GMT
Will eventually be fixed once the GUI rework is done.