Skip to content

Commit cea19a9

Browse files
Component: Fix an issue calculating the relative bounds of opaque components
For top level components the relative bounds of a child opaque component would be wrong unless the top level component was at 0,0
1 parent f257fef commit cea19a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/juce_gui_basics/components/juce_Component.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class Component::OpaqueLayer
264264
explicit OpaqueLayer (const Component&& c) = delete;
265265
explicit OpaqueLayer (const Component& c)
266266
{
267-
appendOpaqueChildren (c);
267+
appendOpaqueChildren (c, c.getPosition());
268268
}
269269

270270
enum class ObscuredByKind
@@ -360,7 +360,7 @@ class Component::OpaqueLayer
360360
}
361361

362362
private:
363-
void appendOpaqueChildren (const Component& parent, Point<int> offset = {})
363+
void appendOpaqueChildren (const Component& parent, Point<int> offset)
364364
{
365365
for (auto* child : parent.getChildren())
366366
{

0 commit comments

Comments
 (0)