Update p.gd

This commit is contained in:
Face
2025-08-22 18:24:29 +03:00
parent 29a0ba0f87
commit e7e7fa569b

View File

@@ -45,31 +45,31 @@ func _auto_resize_to_content():
await get_tree().process_frame await get_tree().process_frame
var content_height = get_content_height() var content_height = get_content_height()
var explicit_height = custom_minimum_size.y if custom_minimum_size.y > 0 else null var explicit_height = custom_minimum_size.y if custom_minimum_size.y > 0 else -1.0
var final_height = explicit_height if explicit_height != null else max(content_height, min_height) var final_height = explicit_height if explicit_height >= 0 else max(content_height, min_height)
custom_minimum_size = Vector2(desired_width, final_height) custom_minimum_size = Vector2(desired_width, final_height)
queue_redraw() queue_redraw()
func _get_font_weight_multiplier() -> float: func _get_font_weight_multiplier() -> float:
if element_styles.has("font-black"): #if element_styles.has("font-black"):
return 1.12 # return 1.12
elif element_styles.has("font-extrabold"): #elif element_styles.has("font-extrabold"):
return 1.10 # return 1.10
elif element_styles.has("font-bold"): #elif element_styles.has("font-bold"):
return 1.04 # return 1.04
elif element_styles.has("font-semibold"): #elif element_styles.has("font-semibold"):
return 1.06 # return 1.06
elif element_styles.has("font-medium"): #elif element_styles.has("font-medium"):
return 1.03 # return 1.03
elif element_styles.has("font-light"): #elif element_styles.has("font-light"):
return 0.98 # return 0.98
elif element_styles.has("font-extralight") or element_styles.has("font-thin"): #elif element_styles.has("font-extralight") or element_styles.has("font-thin"):
return 0.95 # return 0.95
var text_content = get_parsed_text() #var text_content = get_parsed_text()
if text_content.contains("[b]"): #if text_content.contains("[b]"):
return 1.08 # return 1.08
return 1.0 return 1.0