From 6198474d7586a02eac9bf40408124bcdcef16127 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Thu, 21 Nov 2024 17:00:34 -0500 Subject: [PATCH] Static Analyzer Fixes Closes #1452 Closes #1453 --- src-ui/app/browser-ui/BrowserPane.cpp | 2 +- src-ui/app/edit-screen/components/GroupTriggersCard.cpp | 2 +- src-ui/app/edit-screen/components/GroupZoneTreeControl.h | 2 +- src-ui/app/edit-screen/components/ProcessorPane.cpp | 2 +- .../edit-screen/components/mapping-pane/ZoneLayoutDisplay.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src-ui/app/browser-ui/BrowserPane.cpp b/src-ui/app/browser-ui/BrowserPane.cpp index b5fee364..b46bd507 100644 --- a/src-ui/app/browser-ui/BrowserPane.cpp +++ b/src-ui/app/browser-ui/BrowserPane.cpp @@ -340,7 +340,7 @@ struct DriveFSListBoxRow : public juce::Component isMouseDownWithoutDrag = false; - if (!isDragging && e.getDistanceFromDragStart() > 1.5f) + if (!isDragging && e.getDistanceFromDragStart() > 2) { stopPreview(); if (auto *container = juce::DragAndDropContainer::findParentDragContainerFor(this)) diff --git a/src-ui/app/edit-screen/components/GroupTriggersCard.cpp b/src-ui/app/edit-screen/components/GroupTriggersCard.cpp index c5f79e6c..61ed1745 100644 --- a/src-ui/app/edit-screen/components/GroupTriggersCard.cpp +++ b/src-ui/app/edit-screen/components/GroupTriggersCard.cpp @@ -106,7 +106,7 @@ struct GroupTriggersCard::ConditionRow : juce::Component, HasEditor a2M.reset(); } else if ((int)sr.id >= (int)engine::GroupTriggerID::MACRO && - (int)sr.id <= (int)engine::GroupTriggerID::MACRO + scxt::macrosPerPart) + (int)sr.id < (int)engine::GroupTriggerID::MACRO + scxt::macrosPerPart) { auto dm = datamodel::pmd() .asFloat() diff --git a/src-ui/app/edit-screen/components/GroupZoneTreeControl.h b/src-ui/app/edit-screen/components/GroupZoneTreeControl.h index 5090230f..33f88583 100644 --- a/src-ui/app/edit-screen/components/GroupZoneTreeControl.h +++ b/src-ui/app/edit-screen/components/GroupZoneTreeControl.h @@ -318,7 +318,7 @@ template struct GroupZoneListBoxModel : juce:: if (!isZone()) return; - if (!isDragging && e.getDistanceFromDragStart() > 1.5f) + if (!isDragging && e.getDistanceFromDragStart() > 2) { if (auto *container = juce::DragAndDropContainer::findParentDragContainerFor(this)) { diff --git a/src-ui/app/edit-screen/components/ProcessorPane.cpp b/src-ui/app/edit-screen/components/ProcessorPane.cpp index d2d9bca8..54ccca08 100644 --- a/src-ui/app/edit-screen/components/ProcessorPane.cpp +++ b/src-ui/app/edit-screen/components/ProcessorPane.cpp @@ -1196,7 +1196,7 @@ void ProcessorPane::itemDropped(const juce::DragAndDropTarget::SourceDetails &dr void ProcessorPane::mouseDrag(const juce::MouseEvent &e) { - if (!isDragging && e.getDistanceFromDragStart() > 1.5f) + if (!isDragging && e.getDistanceFromDragStart() > 2) { if (auto *container = juce::DragAndDropContainer::findParentDragContainerFor(this)) { diff --git a/src-ui/app/edit-screen/components/mapping-pane/ZoneLayoutDisplay.cpp b/src-ui/app/edit-screen/components/mapping-pane/ZoneLayoutDisplay.cpp index c4064651..19705205 100644 --- a/src-ui/app/edit-screen/components/mapping-pane/ZoneLayoutDisplay.cpp +++ b/src-ui/app/edit-screen/components/mapping-pane/ZoneLayoutDisplay.cpp @@ -298,7 +298,7 @@ void ZoneLayoutDisplay::mouseDrag(const juce::MouseEvent &e) { if (mouseState == DRAG_SELECTED_ZONE) { - if (e.getDistanceFromDragStart() < 2) + if (e.getDistanceFromDragStart() <= 2) { return; }