File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -434,12 +434,12 @@ class AutomationItem final : public Component
434434 return getLocalBounds ().toFloat ().reduced (4 .5f , 3 .0f ).contains (x, y);
435435 }
436436
437- void mouseDown (MouseEvent const & e) override
437+ void mouseDrag (MouseEvent const & e) override
438438 {
439439 if (!isRealClickEvent (e))
440440 return ;
441441
442- if (e.originalComponent == this ) {
442+ if (e.originalComponent == this && e. getDistanceFromDragStart () > 4 ) {
443443 if (auto * editor = findParentComponentOfClass<PluginEditor>()) {
444444 ObjectDragAndDrop::attachToMouse (editor, " #X obj 0 0 param " + param->getTitle ().toString () + " ;" );
445445 }
Original file line number Diff line number Diff line change @@ -231,8 +231,18 @@ void PaletteItem::mouseDown(MouseEvent const& e)
231231
232232 if (reorderButton.get () == e.originalComponent ) {
233233 setIsItemDragged (true );
234- } else if (e.originalComponent == this ) {
235- ObjectDragAndDrop::attachToMouse (editor, palettePatch);
234+ }
235+ }
236+
237+ void PaletteItem::mouseDrag (MouseEvent const & e)
238+ {
239+ if (!isRealClickEvent (e))
240+ return ;
241+
242+ if (e.originalComponent == this && e.getDistanceFromDragStart () > 4 ) {
243+ if (auto * editor = findParentComponentOfClass<PluginEditor>()) {
244+ ObjectDragAndDrop::attachToMouse (editor, palettePatch);
245+ }
236246 }
237247}
238248
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ class PaletteItem final : public Component {
1818 void resized () override ;
1919
2020 void mouseDown (MouseEvent const & e) override ;
21+ void mouseDrag (MouseEvent const & e) override ;
2122 void mouseUp (MouseEvent const & e) override ;
2223 void mouseEnter (MouseEvent const & e) override ;
2324 void mouseExit (MouseEvent const & e) override ;
You can’t perform that action at this time.
0 commit comments