1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-31 03:00:05 +00:00

Added method MouseEvent::mouseWasDraggedSinceMouseDown()

This commit is contained in:
jules 2016-02-16 12:59:49 +00:00
parent b355af98a1
commit 674c833c84
15 changed files with 51 additions and 40 deletions

View file

@ -408,16 +408,16 @@ public:
void mouseUp (const MouseEvent& e) override
{
if (e.mouseWasClicked() && e.getNumberOfClicks() == 2)
if (e.mouseWasDraggedSinceMouseDown())
{
graph.setChangedFlag (true);
}
else if (e.getNumberOfClicks() == 2)
{
if (const AudioProcessorGraph::Node::Ptr f = graph.getNodeForId (filterID))
if (PluginWindow* const w = PluginWindow::getWindowFor (f, PluginWindow::Normal))
w->toFront (true);
}
else if (! e.mouseWasClicked())
{
graph.setChangedFlag (true);
}
}
bool hitTest (int x, int y) override
@ -699,7 +699,11 @@ public:
void mouseDrag (const MouseEvent& e)
{
if ((! dragging) && ! e.mouseWasClicked())
if (dragging)
{
getGraphPanel()->dragConnector (e);
}
else if (e.mouseWasDraggedSinceMouseDown())
{
dragging = true;
@ -715,10 +719,6 @@ public:
destFilterChannel,
e);
}
else if (dragging)
{
getGraphPanel()->dragConnector (e);
}
}
void mouseUp (const MouseEvent& e)