From de7ede266d44cb67ab8251bd9c1d7ac256662307 Mon Sep 17 00:00:00 2001 From: Decapitated Date: Wed, 24 Jul 2024 19:52:43 -0500 Subject: [PATCH] Default View Rect values. --- demo/main.tscn | 7 ------- src/view_rect.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/demo/main.tscn b/demo/main.tscn index 29a424d..df7a509 100644 --- a/demo/main.tscn +++ b/demo/main.tscn @@ -33,10 +33,6 @@ index_path = "example_site/index.html" custom_minimum_size = Vector2(0, 100) layout_mode = 2 size_flags_vertical = 3 -focus_mode = 1 -mouse_filter = 0 -mouse_force_pass_scroll_events = false -expand_mode = 1 [node name="CenterContainer" type="CenterContainer" parent="HSplitContainer/VBoxContainer"] layout_mode = 2 @@ -74,6 +70,3 @@ text = "Click Me!" [node name="InspectorRect" type="InspectorRect" parent="HSplitContainer" node_paths=PackedStringArray("html_rect")] html_rect = NodePath("../VBoxContainer/HtmlRect") layout_mode = 2 -mouse_filter = 0 -mouse_force_pass_scroll_events = false -expand_mode = 1 diff --git a/src/view_rect.cpp b/src/view_rect.cpp index 1d945fd..6b49557 100644 --- a/src/view_rect.cpp +++ b/src/view_rect.cpp @@ -19,6 +19,13 @@ using namespace godot; ViewRect::ViewRect() { + // #region Set default values. + set_expand_mode(TextureRect::ExpandMode::EXPAND_IGNORE_SIZE); + set_mouse_filter(MouseFilter::MOUSE_FILTER_STOP); + set_focus_mode(FocusMode::FOCUS_CLICK); + set_force_pass_scroll_events(false); + // #endregion + image = Ref(); RenderingServer::get_singleton()->connect("frame_post_draw", Callable(this, "render_frame"));