| @@ -124,10 +124,9 @@ void DropShadow::drawForPath (Graphics& g, const Path& path) const | |||||
| { | { | ||||
| jassert (radius > 0); | jassert (radius > 0); | ||||
| const Rectangle<int> area (path.getBounds().translated ((float) offset.x, (float) offset.y) | |||||
| .getSmallestIntegerContainer() | |||||
| .getIntersection (g.getClipBounds()) | |||||
| .expanded (radius + 1, radius + 1)); | |||||
| const Rectangle<int> area ((path.getBounds().getSmallestIntegerContainer() + offset) | |||||
| .getIntersection (g.getClipBounds()) | |||||
| .expanded (radius + 1, radius + 1)); | |||||
| if (area.getWidth() > 2 && area.getHeight() > 2) | if (area.getWidth() > 2 && area.getHeight() > 2) | ||||
| { | { | ||||
| @@ -53,8 +53,6 @@ public: | |||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~ArrowButton(); | ~ArrowButton(); | ||||
| protected: | |||||
| /** @internal */ | /** @internal */ | ||||
| void paintButton (Graphics&, bool isMouseOverButton, bool isButtonDown); | void paintButton (Graphics&, bool isMouseOverButton, bool isButtonDown); | ||||
| @@ -89,9 +89,9 @@ void ShapeButton::paintButton (Graphics& g, bool isMouseOverButton, bool isButto | |||||
| isButtonDown = false; | isButtonDown = false; | ||||
| } | } | ||||
| g.setColour ((isButtonDown) ? downColour | |||||
| : (isMouseOverButton) ? overColour | |||||
| : normalColour); | |||||
| g.setColour (isButtonDown ? downColour | |||||
| : isMouseOverButton ? overColour | |||||
| : normalColour); | |||||
| int w = getWidth(); | int w = getWidth(); | ||||
| int h = getHeight(); | int h = getHeight(); | ||||
| @@ -87,11 +87,8 @@ public: | |||||
| float outlineStrokeWidth); | float outlineStrokeWidth); | ||||
| protected: | |||||
| /** @internal */ | /** @internal */ | ||||
| void paintButton (Graphics& g, | |||||
| bool isMouseOverButton, | |||||
| bool isButtonDown); | |||||
| void paintButton (Graphics&, bool isMouseOverButton, bool isButtonDown); | |||||
| private: | private: | ||||
| //============================================================================== | //============================================================================== | ||||
| @@ -152,7 +152,10 @@ void TabBarButton::setExtraComponent (Component* comp, ExtraComponentPlacement p | |||||
| void TabBarButton::childBoundsChanged (Component* c) | void TabBarButton::childBoundsChanged (Component* c) | ||||
| { | { | ||||
| if (c == extraComponent) | if (c == extraComponent) | ||||
| { | |||||
| owner.resized(); | |||||
| resized(); | resized(); | ||||
| } | |||||
| } | } | ||||
| void TabBarButton::resized() | void TabBarButton::resized() | ||||
| @@ -434,7 +437,6 @@ void TabbedButtonBar::resized() | |||||
| for (int i = 0; i < tabs.size(); ++i) | for (int i = 0; i < tabs.size(); ++i) | ||||
| { | { | ||||
| TabBarButton* const tb = tabs.getUnchecked(i)->button; | TabBarButton* const tb = tabs.getUnchecked(i)->button; | ||||
| const int newLength = totalLength + tb->getBestTabLength (depth); | const int newLength = totalLength + tb->getBestTabLength (depth); | ||||
| if (i > 0 && newLength * minimumScale > tabsButtonPos) | if (i > 0 && newLength * minimumScale > tabsButtonPos) | ||||
| @@ -32,9 +32,7 @@ BubbleComponent::BubbleComponent() | |||||
| setComponentEffect (&shadow); | setComponentEffect (&shadow); | ||||
| } | } | ||||
| BubbleComponent::~BubbleComponent() | |||||
| { | |||||
| } | |||||
| BubbleComponent::~BubbleComponent() {} | |||||
| //============================================================================== | //============================================================================== | ||||
| void BubbleComponent::paint (Graphics& g) | void BubbleComponent::paint (Graphics& g) | ||||
| @@ -43,13 +41,12 @@ void BubbleComponent::paint (Graphics& g) | |||||
| (float) content.getX(), (float) content.getY(), | (float) content.getX(), (float) content.getY(), | ||||
| (float) content.getWidth(), (float) content.getHeight()); | (float) content.getWidth(), (float) content.getHeight()); | ||||
| g.reduceClipRegion (content); | |||||
| g.setOrigin (content.getX(), content.getY()); | g.setOrigin (content.getX(), content.getY()); | ||||
| g.reduceClipRegion (0, 0, content.getWidth(), content.getHeight()); | |||||
| paintContent (g, content.getWidth(), content.getHeight()); | paintContent (g, content.getWidth(), content.getHeight()); | ||||
| } | } | ||||
| //============================================================================== | |||||
| void BubbleComponent::setAllowedPlacement (const int newPlacement) | void BubbleComponent::setAllowedPlacement (const int newPlacement) | ||||
| { | { | ||||
| allowablePlacements = newPlacement; | allowablePlacements = newPlacement; | ||||
| @@ -82,9 +79,8 @@ void BubbleComponent::setPosition (const Rectangle<int>& rectangleToPointTo) | |||||
| content.setBounds (edgeSpace, edgeSpace, contentW, contentH); | content.setBounds (edgeSpace, edgeSpace, contentW, contentH); | ||||
| } | } | ||||
| int totalW = content.getWidth() + edgeSpace * 2; | |||||
| int totalH = content.getHeight() + edgeSpace * 2; | |||||
| int targetX, targetY; | |||||
| const int totalW = content.getWidth() + edgeSpace * 2; | |||||
| const int totalH = content.getHeight() + edgeSpace * 2; | |||||
| const Rectangle<int> availableSpace (getParentComponent() != nullptr ? getParentComponent()->getLocalBounds() | const Rectangle<int> availableSpace (getParentComponent() != nullptr ? getParentComponent()->getLocalBounds() | ||||
| : getParentMonitorArea()); | : getParentMonitorArea()); | ||||
| @@ -106,6 +102,8 @@ void BubbleComponent::setPosition (const Rectangle<int>& rectangleToPointTo) | |||||
| spaceAbove = spaceBelow = 0; | spaceAbove = spaceBelow = 0; | ||||
| } | } | ||||
| int targetX, targetY; | |||||
| if (jmax (spaceAbove, spaceBelow) >= jmax (spaceLeft, spaceRight)) | if (jmax (spaceAbove, spaceBelow) >= jmax (spaceLeft, spaceRight)) | ||||
| { | { | ||||
| targetX = rectangleToPointTo.getCentre().x; | targetX = rectangleToPointTo.getCentre().x; | ||||