Skip to content

Commit 01951a0

Browse files
committed
fix: optimize editor resizing logic in GraphEditorComponent
1 parent c7dc41d commit 01951a0

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/ui/grapheditorcomponent.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,13 @@ class GraphEditor : public juce::Component
245245
{
246246
g.fillAll (findColour (Style::widgetBackgroundColorId).darker());
247247
}
248+
248249
void resized() override
249250
{
250251
auto r = getLocalBounds();
251252
_viewport.setBounds (r);
252-
if (_editor.getWidth() < _viewport.getWidth() || _editor.getHeight() < _viewport.getHeight())
253-
{
254-
_editor.setBounds (_viewport.getBounds());
255-
}
253+
_editor.setSize (jmax (_editor.getWidth(), _viewport.getWidth()),
254+
jmax (_editor.getHeight(), _viewport.getHeight()));
256255
}
257256

258257
juce::Viewport& viewport() { return _viewport; }

0 commit comments

Comments
 (0)