diff options
| -rw-r--r-- | core/variant/variant.cpp | 4 | ||||
| -rw-r--r-- | editor/editor_node.cpp | 8 | ||||
| -rw-r--r-- | editor/editor_resource_picker.cpp | 8 | ||||
| -rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 3 | ||||
| -rw-r--r-- | platform/linuxbsd/x11/key_mapping_x11.cpp | 44 | ||||
| -rw-r--r-- | platform/windows/key_mapping_windows.cpp | 2 | ||||
| -rw-r--r-- | scene/gui/scroll_bar.cpp | 12 |
7 files changed, 57 insertions, 24 deletions
diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp index 2da9559873..fa3bb78913 100644 --- a/core/variant/variant.cpp +++ b/core/variant/variant.cpp @@ -2941,7 +2941,7 @@ uint32_t Variant::recursive_hash(int recursion_count) const { return hash_one_uint64((uint64_t)_data._int); } break; case FLOAT: { - return hash_murmur3_one_float(_data._float); + return hash_murmur3_one_double(_data._float); } break; case STRING: { return reinterpret_cast<const String *>(_data._mem)->hash(); @@ -3158,7 +3158,7 @@ uint32_t Variant::recursive_hash(int recursion_count) const { } return hash_fmix32(h); } else { - return hash_murmur3_one_float(0.0); + return hash_murmur3_one_double(0.0); } } break; diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index b36f74db9c..9b4c39e0d1 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -6482,13 +6482,15 @@ void EditorNode::_bottom_panel_raise_toggled(bool p_pressed) { } void EditorNode::_update_renderer_color() { - if (renderer->get_text() == "Forward+") { + String rendering_method = renderer->get_selected_metadata(); + + if (rendering_method == "forward_plus") { renderer->add_theme_color_override("font_color", Color::hex(0x5d8c3fff)); } - if (renderer->get_text() == "Mobile") { + if (rendering_method == "mobile") { renderer->add_theme_color_override("font_color", Color::hex(0xa5557dff)); } - if (renderer->get_text() == "Compatibility") { + if (rendering_method == "gl_compatibility") { renderer->add_theme_color_override("font_color", Color::hex(0x5586a4ff)); } } diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index 86ffbccefd..a83db21f20 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -399,8 +399,12 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) { file_system_dock->navigate_to_path(edited_resource->get_path()); // Ensure that the FileSystem dock is visible. - TabContainer *tab_container = (TabContainer *)file_system_dock->get_parent_control(); - tab_container->set_current_tab(tab_container->get_tab_idx_from_control(file_system_dock)); + if (file_system_dock->get_window() == get_tree()->get_root()) { + TabContainer *tab_container = (TabContainer *)file_system_dock->get_parent_control(); + tab_container->set_current_tab(tab_container->get_tab_idx_from_control(file_system_dock)); + } else { + file_system_dock->get_window()->grab_focus(); + } } break; default: { diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 5893f53f31..cdd61d7067 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -1110,7 +1110,6 @@ void Node3DEditorViewport::_compute_edit(const Point2 &p_point) { _edit.click_ray = _get_ray(p_point); _edit.click_ray_pos = _get_ray_pos(p_point); _edit.plane = TRANSFORM_VIEW; - spatial_editor->set_local_coords_enabled(false); spatial_editor->update_transform_gizmo(); _edit.center = spatial_editor->get_gizmo_transform().origin; @@ -4866,9 +4865,9 @@ void Node3DEditorViewport::update_transform(Point2 p_mousepos, bool p_shift) { void Node3DEditorViewport::finish_transform() { spatial_editor->set_local_coords_enabled(_edit.original_local); - spatial_editor->update_transform_gizmo(); _edit.mode = TRANSFORM_NONE; _edit.instant = false; + spatial_editor->update_transform_gizmo(); surface->queue_redraw(); } diff --git a/platform/linuxbsd/x11/key_mapping_x11.cpp b/platform/linuxbsd/x11/key_mapping_x11.cpp index fe73162280..0f709872cb 100644 --- a/platform/linuxbsd/x11/key_mapping_x11.cpp +++ b/platform/linuxbsd/x11/key_mapping_x11.cpp @@ -85,8 +85,8 @@ void KeyMappingX11::initialize() { xkeysym_map[XK_Begin] = Key::CLEAR; xkeysym_map[XK_Insert] = Key::INSERT; xkeysym_map[XK_Delete] = Key::KEY_DELETE; - //xkeysym_map[XK_KP_Equal] - //xkeysym_map[XK_KP_Separator] + xkeysym_map[XK_KP_Equal] = Key::EQUAL; + xkeysym_map[XK_KP_Separator] = Key::COMMA; xkeysym_map[XK_KP_Decimal] = Key::KP_PERIOD; xkeysym_map[XK_KP_Delete] = Key::KP_PERIOD; xkeysym_map[XK_KP_Multiply] = Key::KP_MULTIPLY; @@ -220,7 +220,7 @@ void KeyMappingX11::initialize() { scancode_map[0x22] = Key::BRACKETLEFT; scancode_map[0x23] = Key::BRACKETRIGHT; scancode_map[0x24] = Key::ENTER; - scancode_map[0x25] = Key::CTRL; + scancode_map[0x25] = Key::CTRL; // Left scancode_map[0x26] = Key::A; scancode_map[0x27] = Key::S; scancode_map[0x28] = Key::D; @@ -233,7 +233,7 @@ void KeyMappingX11::initialize() { scancode_map[0x2F] = Key::SEMICOLON; scancode_map[0x30] = Key::APOSTROPHE; scancode_map[0x31] = Key::QUOTELEFT; - scancode_map[0x32] = Key::SHIFT; + scancode_map[0x32] = Key::SHIFT; // Left scancode_map[0x33] = Key::BACKSLASH; scancode_map[0x34] = Key::Z; scancode_map[0x35] = Key::X; @@ -245,9 +245,9 @@ void KeyMappingX11::initialize() { scancode_map[0x3B] = Key::COMMA; scancode_map[0x3C] = Key::PERIOD; scancode_map[0x3D] = Key::SLASH; - scancode_map[0x3E] = Key::SHIFT; + scancode_map[0x3E] = Key::SHIFT; // Right scancode_map[0x3F] = Key::KP_MULTIPLY; - scancode_map[0x40] = Key::ALT; + scancode_map[0x40] = Key::ALT; // Left scancode_map[0x41] = Key::SPACE; scancode_map[0x42] = Key::CAPSLOCK; scancode_map[0x43] = Key::F1; @@ -275,14 +275,23 @@ void KeyMappingX11::initialize() { scancode_map[0x59] = Key::KP_3; scancode_map[0x5A] = Key::KP_0; scancode_map[0x5B] = Key::KP_PERIOD; + //scancode_map[0x5C] + //scancode_map[0x5D] // Zenkaku Hankaku scancode_map[0x5E] = Key::SECTION; scancode_map[0x5F] = Key::F11; scancode_map[0x60] = Key::F12; + //scancode_map[0x61] // Romaji + //scancode_map[0x62] // Katakana + //scancode_map[0x63] // Hiragana + //scancode_map[0x64] // Henkan + //scancode_map[0x65] // Hiragana Katakana + //scancode_map[0x66] // Muhenkan + scancode_map[0x67] = Key::COMMA; // KP_Separator scancode_map[0x68] = Key::KP_ENTER; - scancode_map[0x69] = Key::CTRL; + scancode_map[0x69] = Key::CTRL; // Right scancode_map[0x6A] = Key::KP_DIVIDE; scancode_map[0x6B] = Key::PRINT; - scancode_map[0x6C] = Key::ALT; + scancode_map[0x6C] = Key::ALT; // Right scancode_map[0x6D] = Key::ENTER; scancode_map[0x6E] = Key::HOME; scancode_map[0x6F] = Key::UP; @@ -294,13 +303,28 @@ void KeyMappingX11::initialize() { scancode_map[0x75] = Key::PAGEDOWN; scancode_map[0x76] = Key::INSERT; scancode_map[0x77] = Key::KEY_DELETE; + //scancode_map[0x78] // Macro scancode_map[0x79] = Key::VOLUMEMUTE; scancode_map[0x7A] = Key::VOLUMEDOWN; scancode_map[0x7B] = Key::VOLUMEUP; + //scancode_map[0x7C] // Power + scancode_map[0x7D] = Key::EQUAL; // KP_Equal + //scancode_map[0x7E] // KP_PlusMinus scancode_map[0x7F] = Key::PAUSE; - scancode_map[0x85] = Key::META; - scancode_map[0x86] = Key::META; + scancode_map[0x80] = Key::LAUNCH0; + scancode_map[0x81] = Key::COMMA; // KP_Comma + //scancode_map[0x82] // Hangul + //scancode_map[0x83] // Hangul_Hanja + scancode_map[0x84] = Key::YEN; + scancode_map[0x85] = Key::META; // Left + scancode_map[0x86] = Key::META; // Right scancode_map[0x87] = Key::MENU; + + scancode_map[0xA6] = Key::BACK; // On Chromebooks + scancode_map[0xA7] = Key::FORWARD; // On Chromebooks + + scancode_map[0xB5] = Key::REFRESH; // On Chromebooks + scancode_map[0xBF] = Key::F13; scancode_map[0xC0] = Key::F14; scancode_map[0xC1] = Key::F15; diff --git a/platform/windows/key_mapping_windows.cpp b/platform/windows/key_mapping_windows.cpp index aa393464b6..b376854c0c 100644 --- a/platform/windows/key_mapping_windows.cpp +++ b/platform/windows/key_mapping_windows.cpp @@ -315,7 +315,7 @@ void KeyMappingWindows::initialize() { scansym_map[0x51] = Key::KP_3; scansym_map[0x52] = Key::KP_0; scansym_map[0x53] = Key::KP_PERIOD; - scansym_map[0x57] = Key::SECTION; + scansym_map[0x56] = Key::SECTION; scansym_map[0x57] = Key::F11; scansym_map[0x58] = Key::F12; scansym_map[0x5B] = Key::META; diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index b8faf22a59..fcf9302953 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -55,12 +55,14 @@ void ScrollBar::gui_input(const Ref<InputEvent> &p_event) { accept_event(); if (b->get_button_index() == MouseButton::WHEEL_DOWN && b->is_pressed()) { - set_value(get_value() + get_page() / 4.0); + double change = get_page() != 0.0 ? get_page() / 4.0 : (get_max() - get_min()) / 16.0; + set_value(get_value() + MAX(change, get_step())); accept_event(); } if (b->get_button_index() == MouseButton::WHEEL_UP && b->is_pressed()) { - set_value(get_value() - get_page() / 4.0); + double change = get_page() != 0.0 ? get_page() / 4.0 : (get_max() - get_min()) / 16.0; + set_value(get_value() - MAX(change, get_step())); accept_event(); } @@ -99,7 +101,8 @@ void ScrollBar::gui_input(const Ref<InputEvent> &p_event) { if (scrolling) { target_scroll = CLAMP(target_scroll - get_page(), get_min(), get_max() - get_page()); } else { - target_scroll = CLAMP(get_value() - get_page(), get_min(), get_max() - get_page()); + double change = get_page() != 0.0 ? get_page() : (get_max() - get_min()) / 16.0; + target_scroll = CLAMP(get_value() - change, get_min(), get_max() - get_page()); } if (smooth_scroll_enabled) { @@ -122,7 +125,8 @@ void ScrollBar::gui_input(const Ref<InputEvent> &p_event) { if (scrolling) { target_scroll = CLAMP(target_scroll + get_page(), get_min(), get_max() - get_page()); } else { - target_scroll = CLAMP(get_value() + get_page(), get_min(), get_max() - get_page()); + double change = get_page() != 0.0 ? get_page() : (get_max() - get_min()) / 16.0; + target_scroll = CLAMP(get_value() + change, get_min(), get_max() - get_page()); } if (smooth_scroll_enabled) { |
