fix h-full for non-flex divs
This commit is contained in:
@@ -572,8 +572,11 @@ static func parse_utility_class_internal(rule: CSSRule, utility_name: String) ->
|
|||||||
val = val.substr(1, val.length() - 2)
|
val = val.substr(1, val.length() - 2)
|
||||||
rule.properties["width"] = SizeUtils.parse_size(val)
|
rule.properties["width"] = SizeUtils.parse_size(val)
|
||||||
return
|
return
|
||||||
# Height, but h-full is temporarily disabled since it fucks with Yoga layout engine
|
# Height
|
||||||
if utility_name.begins_with("h-") and utility_name != "h-full":
|
if utility_name.begins_with("h-"):
|
||||||
|
# Skip h-full for flex containers as it conflicts with Yoga layout
|
||||||
|
if utility_name == "h-full" and rule.properties.has("display") and (rule.properties["display"] == "flex" or rule.properties["display"] == "inline-flex"):
|
||||||
|
return
|
||||||
var val = utility_name.substr(2)
|
var val = utility_name.substr(2)
|
||||||
if val.begins_with("[") and val.ends_with("]"):
|
if val.begins_with("[") and val.ends_with("]"):
|
||||||
val = val.substr(1, val.length() - 2)
|
val = val.substr(1, val.length() - 2)
|
||||||
|
|||||||
@@ -89,6 +89,11 @@ static func apply_element_styles(node: Control, element: HTMLParser.HTMLElement,
|
|||||||
if height == "100%":
|
if height == "100%":
|
||||||
node.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
node.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||||
node.custom_minimum_size.y = 0
|
node.custom_minimum_size.y = 0
|
||||||
|
if node is PanelContainer and node.get_child_count() > 0:
|
||||||
|
var vbox = node.get_child(0)
|
||||||
|
if vbox is VBoxContainer:
|
||||||
|
vbox.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||||
|
node.set_meta("size_flags_set_by_style_manager", true)
|
||||||
else:
|
else:
|
||||||
# For other percentages, convert to viewport-relative size
|
# For other percentages, convert to viewport-relative size
|
||||||
var percent = float(height.replace("%", "")) / 100.0
|
var percent = float(height.replace("%", "")) / 100.0
|
||||||
|
|||||||
Reference in New Issue
Block a user