1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Renamed bounds member variable in Component to "boundsRelativeToParent" to avoid shadowing warnings when using a local variable nambed "bounds"

This commit is contained in:
hogliux 2016-10-27 16:52:47 +01:00
parent 5d0256982b
commit 75ea6db250
3 changed files with 18 additions and 18 deletions

View file

@ -409,7 +409,7 @@ struct Component::ComponentHelpers
if (child.isVisible() && ! child.isTransformed())
{
const Rectangle<int> newClip (clipRect.getIntersection (child.bounds));
const Rectangle<int> newClip (clipRect.getIntersection (child.boundsRelativeToParent));
if (! newClip.isEmpty())
{
@ -665,7 +665,7 @@ void Component::addToDesktop (int styleWanted, void* nativeWindowToAttachTo)
Desktop::getInstance().addDesktopComponent (this);
bounds.setPosition (topLeft);
boundsRelativeToParent.setPosition (topLeft);
peer->updateBounds();
if (oldRenderingEngine >= 0)
@ -1031,8 +1031,8 @@ bool Component::isAlwaysOnTop() const noexcept
}
//==============================================================================
int Component::proportionOfWidth (const float proportion) const noexcept { return roundToInt (proportion * bounds.getWidth()); }
int Component::proportionOfHeight (const float proportion) const noexcept { return roundToInt (proportion * bounds.getHeight()); }
int Component::proportionOfWidth (const float proportion) const noexcept { return roundToInt (proportion * boundsRelativeToParent.getWidth()); }
int Component::proportionOfHeight (const float proportion) const noexcept { return roundToInt (proportion * boundsRelativeToParent.getHeight()); }
int Component::getParentWidth() const noexcept
{
@ -1135,7 +1135,7 @@ void Component::setBounds (const int x, const int y, int w, int h)
repaintParent();
}
bounds.setBounds (x, y, w, h);
boundsRelativeToParent.setBounds (x, y, w, h);
if (showing)
{
@ -2249,13 +2249,13 @@ void Component::setPositioner (Positioner* newPositioner)
//==============================================================================
Rectangle<int> Component::getLocalBounds() const noexcept
{
return bounds.withZeroOrigin();
return boundsRelativeToParent.withZeroOrigin();
}
Rectangle<int> Component::getBoundsInParent() const noexcept
{
return affineTransform == nullptr ? bounds
: bounds.transformedBy (*affineTransform);
return affineTransform == nullptr ? boundsRelativeToParent
: boundsRelativeToParent.transformedBy (*affineTransform);
}
//==============================================================================

View file

@ -253,7 +253,7 @@ public:
bounds will no longer be a direct reflection of the position at which it appears within
its parent, as the transform will be applied to its bounding box.
*/
int getX() const noexcept { return bounds.getX(); }
int getX() const noexcept { return boundsRelativeToParent.getX(); }
/** Returns the y coordinate of the top of this component.
This is a distance in pixels from the top edge of the component's parent.
@ -262,13 +262,13 @@ public:
bounds will no longer be a direct reflection of the position at which it appears within
its parent, as the transform will be applied to its bounding box.
*/
int getY() const noexcept { return bounds.getY(); }
int getY() const noexcept { return boundsRelativeToParent.getY(); }
/** Returns the component's width in pixels. */
int getWidth() const noexcept { return bounds.getWidth(); }
int getWidth() const noexcept { return boundsRelativeToParent.getWidth(); }
/** Returns the component's height in pixels. */
int getHeight() const noexcept { return bounds.getHeight(); }
int getHeight() const noexcept { return boundsRelativeToParent.getHeight(); }
/** Returns the x coordinate of the component's right-hand edge.
This is a distance in pixels from the left edge of the component's parent.
@ -277,10 +277,10 @@ public:
bounds will no longer be a direct reflection of the position at which it appears within
its parent, as the transform will be applied to its bounding box.
*/
int getRight() const noexcept { return bounds.getRight(); }
int getRight() const noexcept { return boundsRelativeToParent.getRight(); }
/** Returns the component's top-left position as a Point. */
Point<int> getPosition() const noexcept { return bounds.getPosition(); }
Point<int> getPosition() const noexcept { return boundsRelativeToParent.getPosition(); }
/** Returns the y coordinate of the bottom edge of this component.
This is a distance in pixels from the top edge of the component's parent.
@ -289,7 +289,7 @@ public:
bounds will no longer be a direct reflection of the position at which it appears within
its parent, as the transform will be applied to its bounding box.
*/
int getBottom() const noexcept { return bounds.getBottom(); }
int getBottom() const noexcept { return boundsRelativeToParent.getBottom(); }
/** Returns this component's bounding box.
The rectangle returned is relative to the top-left of the component's parent.
@ -298,7 +298,7 @@ public:
bounds will no longer be a direct reflection of the position at which it appears within
its parent, as the transform will be applied to its bounding box.
*/
const Rectangle<int>& getBounds() const noexcept { return bounds; }
const Rectangle<int>& getBounds() const noexcept { return boundsRelativeToParent; }
/** Returns the component's bounds, relative to its own origin.
This is like getBounds(), but returns the rectangle in local coordinates, In practice, it'll
@ -2244,7 +2244,7 @@ private:
//==============================================================================
String componentName, componentID;
Component* parentComponent;
Rectangle<int> bounds;
Rectangle<int> boundsRelativeToParent;
ScopedPointer<Positioner> positioner;
ScopedPointer<AffineTransform> affineTransform;
Array<Component*> childComponentList;

View file

@ -320,7 +320,7 @@ void ComponentPeer::handleMovedOrResized()
if (wasMoved || wasResized)
{
component.bounds = newBounds;
component.boundsRelativeToParent = newBounds;
if (wasResized)
component.repaint();