mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-03 03:30:06 +00:00
New class LeakedObjectDetector, and JUCE_LEAK_DETECTOR macros for spotting leakages in a neat, cross-platform way. Used these to replace all the old juce_UseDebuggingNewOperator stuff in all the classes. Also some drawable and component transform fixes.
This commit is contained in:
parent
1629f9f66a
commit
a5cf4030f5
374 changed files with 2064 additions and 3331 deletions
|
|
@ -42,7 +42,7 @@ ComponentDragger::~ComponentDragger()
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
void ComponentDragger::startDraggingComponent (Component* const componentToDrag,
|
||||
void ComponentDragger::startDraggingComponent (Component* const componentToDrag, const MouseEvent& e,
|
||||
ComponentBoundsConstrainer* const constrainer_)
|
||||
{
|
||||
jassert (componentToDrag != 0);
|
||||
|
|
@ -50,7 +50,7 @@ void ComponentDragger::startDraggingComponent (Component* const componentToDrag,
|
|||
if (componentToDrag != 0)
|
||||
{
|
||||
constrainer = constrainer_;
|
||||
originalPos = componentToDrag->localPointToGlobal (Point<int>());
|
||||
mouseDownWithinTarget = e.getEventRelativeTo (componentToDrag).getMouseDownPosition();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -61,13 +61,8 @@ void ComponentDragger::dragComponent (Component* const componentToDrag, const Mo
|
|||
|
||||
if (componentToDrag != 0)
|
||||
{
|
||||
Rectangle<int> bounds (componentToDrag->getBounds().withPosition (originalPos));
|
||||
|
||||
const Component* const parentComp = componentToDrag->getParentComponent();
|
||||
if (parentComp != 0)
|
||||
bounds.setPosition (parentComp->getLocalPoint (0, originalPos));
|
||||
|
||||
bounds.setPosition (bounds.getPosition() + e.getOffsetFromDragStart());
|
||||
Rectangle<int> bounds (componentToDrag->getBounds());
|
||||
bounds += e.getEventRelativeTo (componentToDrag).getPosition() - mouseDownWithinTarget;
|
||||
|
||||
if (constrainer != 0)
|
||||
constrainer->setBoundsForComponent (componentToDrag, bounds, false, false, false, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue