Skip to content

Commit

Permalink
Prevent connect scroll_to_paragraph multiple times to class_desc
Browse files Browse the repository at this point in the history
  • Loading branch information
jsjtxietian committed May 29, 2024
1 parent be56cab commit b33811d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions editor/editor_help.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2340,6 +2340,9 @@ void EditorHelp::_help_callback(const String &p_topic) {

if (class_desc->is_ready()) {
// call_deferred() is not enough.
if (class_desc->is_connected(SceneStringName(draw), callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph))) {
class_desc->disconnect(SceneStringName(draw), callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph));
}
class_desc->connect(SceneStringName(draw), callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph).bind(line), CONNECT_ONE_SHOT | CONNECT_DEFERRED);
} else {
scroll_to = line;
Expand Down

0 comments on commit b33811d

Please sign in to comment.