1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00
JUCE/modules/juce_gui_basics/layout
reuk ad5a755b10
Viewport: Avoid stack overflows when displaying transformed content components
For some transforms, the program could get stuck in the following loop:
- The content component emits a resized/moved notification, leading to
  the initial call to Viewport::updateVisibleArea.
- New positions are computed for the viewport scrollbars, and scrollbar
  listeners are notified synchronously that the scrollbars have been
  updated.
- The viewport itself listens to the scrollbars, so it receives a
  notification and updates the position of the content component.
- The scrollbar position (quantised to an integer) resolves to a
  component position (also quantised to an integer) that differs from
  the existing position, so the new position is applied.
- The viewport now attempts to set the scrollbars to the correct
  position in response, and notifies listeners that the scrollbars
  have moved...

Normally, the recursion would exit at the point where the component position
is set to its current position. If we're unlucky, though, converting
from view pos to scrollbar pos, then scrollbar pos back to view pos may
result in a view pos that differs from the original value.

This fix adds a new exit condition from the recursion. On receiving a
scrollbar move notification, we check whether the scrollbar position
computed from the current view position matches the incoming scrollbar
position. If it does, there's no need to compute and apply a new view
position from the incoming scrollbar position.
2024-10-02 11:35:38 +01:00
..
juce_AnimatedPosition.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_AnimatedPositionBehaviours.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_BorderedComponentBoundsConstrainer.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_BorderedComponentBoundsConstrainer.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_ComponentAnimator.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_ComponentAnimator.h Animation: Add juce_animation module 2024-04-16 17:43:21 +01:00
juce_ComponentBoundsConstrainer.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_ComponentBoundsConstrainer.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_ComponentBuilder.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_ComponentBuilder.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_ComponentMovementWatcher.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_ComponentMovementWatcher.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_ConcertinaPanel.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_ConcertinaPanel.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_FlexBox.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_FlexBox.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_FlexItem.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_Grid.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_Grid.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_GridItem.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_GridItem.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_GroupComponent.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_GroupComponent.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_MultiDocumentPanel.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_MultiDocumentPanel.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_ResizableBorderComponent.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_ResizableBorderComponent.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_ResizableCornerComponent.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_ResizableCornerComponent.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_ResizableEdgeComponent.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_ResizableEdgeComponent.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_ScrollBar.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_ScrollBar.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_SidePanel.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_SidePanel.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_StretchableLayoutManager.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_StretchableLayoutManager.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_StretchableLayoutResizerBar.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_StretchableLayoutResizerBar.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_StretchableObjectResizer.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_StretchableObjectResizer.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_TabbedButtonBar.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_TabbedButtonBar.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_TabbedComponent.cpp Update licensing information 2024-04-16 11:39:35 +01:00
juce_TabbedComponent.h Update licensing information 2024-04-16 11:39:35 +01:00
juce_Viewport.cpp Viewport: Avoid stack overflows when displaying transformed content components 2024-10-02 11:35:38 +01:00
juce_Viewport.h Viewport: Avoid stack overflows when displaying transformed content components 2024-10-02 11:35:38 +01:00