1
0
mirror of synced 2024-11-12 10:10:53 +01:00

fix: Pattern editor drag bar not always getting dragged correctly

This commit is contained in:
WerWolv 2023-06-12 08:55:30 +02:00
parent 7de367a944
commit 3b514003f8

View File

@ -126,15 +126,18 @@ namespace hex::plugin::builtin {
this->m_textEditor.Render("hex.builtin.view.pattern_editor.name"_lang, textEditorSize, true);
ImGui::Button("##settings_drag_bar", ImVec2(ImGui::GetContentRegionAvail().x, 2_scaled));
if (ImGui::IsMouseDragging(ImGuiMouseButton_Left, 1)) {
if (ImGui::IsItemHovered(ImGuiHoveredFlags_RectOnly))
if (ImGui::IsMouseDragging(ImGuiMouseButton_Left, 0)) {
if (ImGui::IsItemHovered())
dragging = true;
} else {
dragging = false;
}
if (ImGui::IsItemHovered()) {
ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeNS);
}
if (dragging) {
height += ImGui::GetMouseDragDelta(ImGuiMouseButton_Left).y;
height += ImGui::GetMouseDragDelta(ImGuiMouseButton_Left, 0).y;
ImGui::ResetMouseDragDelta(ImGuiMouseButton_Left);
}