Skip to content

Commit

Permalink
Fix issue in osx
Browse files Browse the repository at this point in the history
  • Loading branch information
kunitoki committed Dec 5, 2024
1 parent c157170 commit f3ec069
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
9 changes: 6 additions & 3 deletions examples/render/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ class CustomWindow
setTitle ("main");

#if JUCE_WASM
yup::File riveFilePath = yup::File ("/data");
yup::File riveFilePath = yup::File ("/data")
.getChildFile ("artboard.riv");
#else
yup::File riveFilePath = yup::File (__FILE__).getParentDirectory().getSiblingFile ("data");
yup::File riveFilePath = yup::File (__FILE__)
.getParentDirectory()
.getSiblingFile ("data")
.getChildFile ("alien.riv");
#endif
riveFilePath = riveFilePath.getChildFile ("artboard.riv");

// Setup artboards
for (int i = 0; i < totalRows * totalColumns; ++i)
Expand Down
18 changes: 4 additions & 14 deletions modules/yup_gui/component/yup_Component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,10 @@ void Component::moved()

void Component::setSize (const Size<float>& newSize)
{
boundsInParent = boundsInParent.withSize (newSize);

if (options.onDesktop)
{
native->setSize(newSize.to<int>());
boundsInParent = Rectangle<float>(0.0f, 0.0f, native->getSize().to<float>());
}
else
{
boundsInParent = boundsInParent.withSize (newSize);
}

resized();
}
Expand Down Expand Up @@ -189,15 +184,10 @@ float Component::getHeight() const

void Component::setBounds (const Rectangle<float>& newBounds)
{
boundsInParent = newBounds;

if (options.onDesktop)
{
native->setBounds(newBounds.to<int>());
boundsInParent = native->getBounds().to<float>();
}
else
{
boundsInParent = newBounds;
}

resized();
}
Expand Down

0 comments on commit f3ec069

Please sign in to comment.