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
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
..
accessibility Update licensing information 2024-04-16 11:39:35 +01:00
application Update licensing information 2024-04-16 11:39:35 +01:00
buttons Font: Deprecate getStringWidth and getGlyphPositions 2024-09-18 19:13:09 +01:00
commands Update licensing information 2024-04-16 11:39:35 +01:00
components DocumentWindow: Ensure button callbacks are called on Windows 2024-09-30 20:12:51 +01:00
desktop Reapply "Windows: Use new window hit-testing API to implement Windows window-management features like Aero Snap" 2024-07-29 16:11:59 +01:00
detail FocusHelpers: Reduce code nesting 2024-08-01 16:10:09 +00:00
drawables Font: Deprecate getStringWidth and getGlyphPositions 2024-09-18 19:13:09 +01:00
filebrowser Versioning: Add the JUCE version number to any internally created threads 2024-09-26 08:10:56 +00:00
keyboard FocusTraverser: Make more things const 2024-08-01 16:10:09 +00:00
layout Viewport: Avoid stack overflows when displaying transformed content components 2024-10-02 11:35:38 +01:00
lookandfeel Font: Deprecate getStringWidth and getGlyphPositions 2024-09-18 19:13:09 +01:00
menus Update licensing information 2024-04-16 11:39:35 +01:00
misc Projucer: Remove the JUCE splash screen and update licensing 2024-04-16 17:43:19 +01:00
mouse Direct2D: Add initial support 2024-04-18 14:16:02 +01:00
native Direct2D: Avoid unnecessarily reallocating window buffers during window move 2024-10-02 11:35:37 +01:00
positioning Update licensing information 2024-04-16 11:39:35 +01:00
properties Update licensing information 2024-04-16 11:39:35 +01:00
widgets Font: Deprecate getStringWidth and getGlyphPositions 2024-09-18 19:13:09 +01:00
windows DocumentWindow: Ensure button callbacks are called on Windows 2024-09-30 20:12:51 +01:00
juce_gui_basics.cpp Direct2D: Share more implementation headers between modules 2024-08-22 18:18:14 +01:00
juce_gui_basics.h Bump version number to 8.0.2 2024-09-26 08:31:50 +01:00
juce_gui_basics.mm Update licensing information 2024-04-16 11:39:35 +01:00