Add what's new in 2.0.0 to the About popup
The layout test lets the changelog grow in height with its text, and still checks its position and width.
This commit is contained in:
1 parent
d77b72159d
commit
5519afb5f6
2 files changed
+26
-1
No files matched your search
@@ -68,6 +68,12 @@ const RENAMED_PATHS: Dictionary = {
|
||||
SYNC_COLUMNS + "/CaughtErrorsVBox/CaughtErrorsLabel",
|
||||
}
|
||||
|
||||
## Nodes whose height follows text that changes between versions, such as the changelog.
|
||||
## Their position and width are still checked.
|
||||
const HEIGHT_FOLLOWS_TEXT: Array[String] = [
|
||||
"AboutPopup/AboutPanel/ScrollContainer/ContentVBox",
|
||||
]
|
||||
|
||||
## How far a node may be from its old place, in pixels.
|
||||
const TOLERANCE: float = 0.5
|
||||
|
||||
@@ -134,7 +140,8 @@ func test_every_node_is_where_it_was() -> void:
|
||||
problems.append("%s: %s is missing (was %s)" % [state, path, old_path])
|
||||
continue
|
||||
var rect: Array = actual[path].rect
|
||||
for i: int in 4:
|
||||
var sides: int = 3 if _height_follows_text(path) else 4
|
||||
for i: int in sides:
|
||||
if absf(rect[i] - expected.rect[i]) > TOLERANCE:
|
||||
problems.append("%s: %s is at %s, was %s"
|
||||
% [state, path, rect, expected.rect])
|
||||
@@ -145,3 +152,8 @@ func test_every_node_is_where_it_was() -> void:
|
||||
assert_array(problems).override_failure_message(
|
||||
"%d nodes moved:\n%s" % [problems.size(), "\n".join(problems.slice(0, 30))]) \
|
||||
.is_empty()
|
||||
|
||||
|
||||
static func _height_follows_text(path: String) -> bool:
|
||||
return HEIGHT_FOLLOWS_TEXT.any(func(node_path: String) -> bool:
|
||||
return path == node_path || path.begins_with(node_path + "/"))
|
||||
Reference in new issue
Block a user