diff options
author | Juan Linietsky <reduzio@gmail.com> | 2023-01-08 00:55:54 +0100 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2023-01-08 22:17:40 +0100 |
commit | 2b815df3c19499f9fcf1575cfce1477876030e81 (patch) | |
tree | 60ee896d674ff9194f51fb3b1e5d27d8efb7b328 /editor/plugins/mesh_editor_plugin.cpp | |
parent | fcba87e696d58912838d8a4a6987b10efa28e78f (diff) | |
download | redot-engine-2b815df3c19499f9fcf1575cfce1477876030e81.tar.gz |
Use BitField<> in core type masks
* All core types masks are now correctly marked as bitfields.
* The enum hacks in MouseButtonMask and many other types are gone. This ensures that binders to other languages non C++ can actually implement type safe bitmasks.
* Most bitmask operations replaced by functions in BitField<>
* Key is still a problem because its enum and mask at the same time. While it kind of works in C++, this most likely can't be implemented safely in other languages and will have to be changed at some point. Mostly left as-is.
* Documentation and API dump updated to reflect bitfields in core types.
Diffstat (limited to 'editor/plugins/mesh_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/mesh_editor_plugin.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp index a9cbec00b5..ee555ae8d4 100644 --- a/editor/plugins/mesh_editor_plugin.cpp +++ b/editor/plugins/mesh_editor_plugin.cpp @@ -39,7 +39,7 @@ void MeshEditor::gui_input(const Ref<InputEvent> &p_event) { ERR_FAIL_COND(p_event.is_null()); Ref<InputEventMouseMotion> mm = p_event; - if (mm.is_valid() && (mm->get_button_mask() & MouseButton::MASK_LEFT) != MouseButton::NONE) { + if (mm.is_valid() && (mm->get_button_mask().has_flag(MouseButtonMask::LEFT))) { rot_x -= mm->get_relative().y * 0.01; rot_y -= mm->get_relative().x * 0.01; if (rot_x < -Math_PI / 2) { |