diff --git a/modules/juce_core/threads/juce_CriticalSection.h b/modules/juce_core/threads/juce_CriticalSection.h index b0a6e95521..9322d8350f 100644 --- a/modules/juce_core/threads/juce_CriticalSection.h +++ b/modules/juce_core/threads/juce_CriticalSection.h @@ -31,9 +31,9 @@ //============================================================================== /** - A mutex class. + A re-entrant mutex. - A CriticalSection acts as a re-entrant mutex lock. The best way to lock and unlock + A CriticalSection acts as a re-entrant mutex object. The best way to lock and unlock one of these is by using RAII in the form of a local ScopedLock object - have a look through the codebase for many examples of how to do this. diff --git a/modules/juce_graphics/geometry/juce_Rectangle.h b/modules/juce_graphics/geometry/juce_Rectangle.h index 41170b8ce4..96440a5932 100644 --- a/modules/juce_graphics/geometry/juce_Rectangle.h +++ b/modules/juce_graphics/geometry/juce_Rectangle.h @@ -478,6 +478,17 @@ public: jlimit (pos.y, pos.y + h, point.y)); } + /** Returns a point within this rectangle, specified as proportional coordinates. + The relative X and Y values should be between 0 and 1, where 0 is the left or + top of this rectangle, and 1 is the right or bottom. (Out-of-bounds values + will return a point outside the rectangle). + */ + Point getRelativePoint (double relativeX, double relativeY) const noexcept + { + return Point (pos.x + static_cast (w * relativeX), + pos.y + static_cast (h * relativeY)); + } + /** Returns true if any part of another rectangle overlaps this one. */ bool intersects (const Rectangle& other) const noexcept { diff --git a/modules/juce_gui_basics/components/juce_Component.h b/modules/juce_gui_basics/components/juce_Component.h index ee716cb5a1..fb29e13420 100644 --- a/modules/juce_gui_basics/components/juce_Component.h +++ b/modules/juce_gui_basics/components/juce_Component.h @@ -810,8 +810,9 @@ public: */ virtual void parentHierarchyChanged(); - /** Subclasses can use this callback to be told when children are added or removed. - @see parentHierarchyChanged + /** Subclasses can use this callback to be told when children are added or removed, or + when their z-order changes. + @see parentHierarchyChanged, ComponentListener::componentChildrenChanged */ virtual void childrenChanged(); diff --git a/modules/juce_gui_basics/components/juce_ComponentListener.h b/modules/juce_gui_basics/components/juce_ComponentListener.h index 7ad0304bf9..c109250a6f 100644 --- a/modules/juce_gui_basics/components/juce_ComponentListener.h +++ b/modules/juce_gui_basics/components/juce_ComponentListener.h @@ -71,9 +71,10 @@ public: */ virtual void componentVisibilityChanged (Component& component); - /** Called when the component has children added or removed. + /** Called when the component has children added or removed, or their z-order + changes. - @param component the component whose children were changed + @param component the component whose children have changed @see Component::childrenChanged, Component::addChildComponent, Component::removeChildComponent */