diff options
-rw-r--r-- | doc/classes/EditorInspectorPlugin.xml | 2 | ||||
-rw-r--r-- | doc/classes/EditorPlugin.xml | 4 | ||||
-rw-r--r-- | editor/editor_inspector.h | 2 | ||||
-rw-r--r-- | editor/editor_plugin.cpp | 6 | ||||
-rw-r--r-- | editor/editor_plugin.h | 4 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 4 |
6 files changed, 10 insertions, 12 deletions
diff --git a/doc/classes/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml index 7ffd7f9426..bbd383edc0 100644 --- a/doc/classes/EditorInspectorPlugin.xml +++ b/doc/classes/EditorInspectorPlugin.xml @@ -18,7 +18,7 @@ <methods> <method name="_can_handle" qualifiers="virtual const"> <return type="bool" /> - <param index="0" name="object" type="Variant" /> + <param index="0" name="object" type="Object" /> <description> Returns [code]true[/code] if this object can be handled by this plugin. </description> diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index f4b912de9e..95c0f8efe1 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -38,7 +38,7 @@ </method> <method name="_edit" qualifiers="virtual"> <return type="void" /> - <param index="0" name="object" type="Variant" /> + <param index="0" name="object" type="Object" /> <description> This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object. [param object] can be [code]null[/code] if the plugin was editing an object, but there is no longer any selected object handled by this plugin. It can be used to cleanup editing state. @@ -295,7 +295,7 @@ </method> <method name="_handles" qualifiers="virtual const"> <return type="bool" /> - <param index="0" name="object" type="Variant" /> + <param index="0" name="object" type="Object" /> <description> Implement this function if your plugin edits a specific type of object (Resource or Node). If you return [code]true[/code], then you will get the functions [method _edit] and [method _make_visible] called when the editor requests them. If you have declared the methods [method _forward_canvas_gui_input] and [method _forward_3d_gui_input] these will be called too. </description> diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index 4ffba18181..01231108d8 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -225,7 +225,7 @@ public: protected: static void _bind_methods(); - GDVIRTUAL1RC(bool, _can_handle, Variant) + GDVIRTUAL1RC(bool, _can_handle, Object *) GDVIRTUAL1(_parse_begin, Object *) GDVIRTUAL2(_parse_category, Object *, String) GDVIRTUAL2(_parse_group, Object *, String) diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 14cdbc364e..7b01ae69bf 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -662,11 +662,7 @@ void EditorPlugin::make_visible(bool p_visible) { } void EditorPlugin::edit(Object *p_object) { - if (Object::cast_to<Resource>(p_object)) { - GDVIRTUAL_CALL(_edit, Ref<Resource>(Object::cast_to<Resource>(p_object))); - } else { - GDVIRTUAL_CALL(_edit, p_object); - } + GDVIRTUAL_CALL(_edit, p_object); } bool EditorPlugin::handles(Object *p_object) const { diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h index a5a17acdf1..74f46b2d0b 100644 --- a/editor/editor_plugin.h +++ b/editor/editor_plugin.h @@ -164,8 +164,8 @@ protected: GDVIRTUAL0RC(Ref<Texture2D>, _get_plugin_icon) GDVIRTUAL0RC(bool, _has_main_screen) GDVIRTUAL1(_make_visible, bool) - GDVIRTUAL1(_edit, Variant) - GDVIRTUAL1RC(bool, _handles, Variant) + GDVIRTUAL1(_edit, Object *) + GDVIRTUAL1RC(bool, _handles, Object *) GDVIRTUAL0RC(Dictionary, _get_state) GDVIRTUAL1(_set_state, Dictionary) GDVIRTUAL0(_clear) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index d785280701..2b3b577697 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4362,7 +4362,9 @@ int TextEdit::get_minimap_line_at_pos(const Point2i &p_pos) const { if (first_vis_line > 0 && minimap_line >= 0) { minimap_line -= get_next_visible_line_index_offset_from(first_vis_line, 0, -num_lines_before).x; minimap_line -= (minimap_line > 0 && smooth_scroll_enabled ? 1 : 0); - } else { + } + + if (minimap_line < 0) { minimap_line = 0; } |