Skip to content

Partial text omitted in Button #100455

Description

@MarcoRizz

Tested versions

v4.3.stable.official [77dcf97]

System information

Godot v4.3.stable - Windows 10.0.26100 - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 4070 (NVIDIA; 32.0.15.6614) - AMD Ryzen 7 7800X3D 8-Core Processor (16 Threads)

Issue description

I have several buttons with text. All works fine except for this one that have the specific text "DESUMI". I note that typing the last "I" the button get wider, but the letter does not appear. Other buttons that terminates with the same letter "I" works correctly.
https://github.com/user-attachments/assets/a8172034-9a17-40b2-bf5d-a8c604aedf37

Steps to reproduce

Running the scene:

[gd_scene load_steps=2 format=3 uid="uid://dymocognk601v"]

[ext_resource type="Script" path="res://scripts/wordpanel_parola.gd" id="1_omrdl"]

[node name="Parola" type="Button"]
offset_right = 8.0
offset_bottom = 8.0
focus_mode = 0
mouse_filter = 1
text = "DESUMI"
script = ExtResource("1_omrdl")

[connection signal="button_down" from="." to="." method="_on_button_down"]
[connection signal="pressed" from="." to="." method="_on_pressed"]

with the script:

extends Button

signal show_path(word: String)

# Variabili per il click delle parole
const max_holding_time = 0.5 #secondi
var holding_click_delta_time
var hold_event_run


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	if is_pressed() and hold_event_run:
		# Se il tempo di hold è stato superato, esegui un'azione
		if holding_click_delta_time > max_holding_time:
			# Recupera il testo della label per comporre l'URL
			var url = "https://www.google.com/search?q=" + text + "+vocabolario"
			
			# Apre l'URL nel browser
			OS.shell_open(url)
			hold_event_run = false
		else:
			holding_click_delta_time += delta


func _on_button_down() -> void:
	holding_click_delta_time = 0
	hold_event_run = true


func set_revealed_word() -> void:
	var color = Color(1, 0.3, 0.3)
	set("theme_override_colors/font_color", color)
	set("theme_override_colors/font_pressed_color", color)
	set("theme_override_colors/font_hover_color", color)


func _on_pressed() -> void:
	show_path.emit(text)

Minimal reproduction project (MRP)

Not sure if project dependent.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions