1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00
Commit graph

52 commits

Author SHA1 Message Date
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
Tom Poole
94d98a2b10 Update licensing information 2024-04-16 11:39:35 +01:00
reuk
9cfbccca8e
Accessibility: Make createAccessibilityHandler public to allow calls from derived classes 2023-02-09 17:54:18 +00:00
attila
27924e4996 Viewport: Stop ongoing physical drag upon user interaction
An animated drag operation will now stop if the user interacts with
the content area again before the animation is finished. It is also
stopped if the user interacts with the scrollbars.
2022-06-30 15:10:15 +00:00
reuk
53484db875
Accessibility: Avoid allowing TextEditor and Viewport internal components to be accessibility-focused
The TextHolderComponent and Viewport::componentHolder don't have any
accessible semantics, so they shouldn't be included in the accessible
component hierarchy.
2022-06-13 15:29:57 +01:00
Tom Poole
2ec861d99e Update licensing banners to JUCE 7 2022-05-16 17:55:48 +01:00
Tom Poole
dea3fe60e4 Update copyright banners 2022-04-04 12:36:32 +01:00
reuk
4cf74dfff6 Viewport: Improve drag-to-scroll on devices that can accept simultaneous mouse and touch input
Some Windows 11 devices have both touch screens and mouse inputs, and
these can be used simultaneously.

The Viewport (and ListBox) now check the input source of each mouse
down. If the source is not a mouse, the viewport will always enter
drag-to-scroll mode, regardless of the result of isScrollOnDragEnabled.
2022-02-07 14:24:11 +00:00
ed
bbc05adb17 Docs: Updated Viewport scrollbar docs 2021-06-07 19:38:29 +01:00
ed
009d685179 Updated all license headers 2020-06-29 08:30:22 +01:00
Tom Poole
894e7d2bd2 Updated all license headers 2020-04-23 17:30:39 +01:00
reuk
327f817b9b Copyrights: Update commercial/gpl headers to be gpl-only 2020-04-09 15:22:56 +01:00
Tom Poole
16dd26649a Fixed some GCC compiler warnings and removed deprecated functions 2019-06-04 16:48:44 +01:00
ed
3c6b4f1e95 Minor documentation update for the Viewport::setScrollOnDragEnabled() method 2019-02-18 11:22:16 +00:00
jules
cadac817c6 Enabled some more warning flags in Xcode, and fixed the problems they caused 2019-01-11 09:52:10 +00:00
jules
7ab4d1708b Some misc cleanups, mainly around WeakReference usage and rectangles 2018-07-09 16:00:45 +01:00
jules
974b4a8351 Removed some legacy friend class declarations that are no longer needed with modern compilers 2018-06-13 17:11:37 +01:00
Tom Poole
ab863a6dc2 Replaced all usage of ScopedPointer with std::unique_ptr 2018-04-19 20:27:47 +01:00
hogliux
3ae28b3d54 Viewport: Added the ability to position the scrollbars at the top/left 2018-03-19 14:00:31 +00:00
ed
cdbc28c18b Add documentation tags 2018-03-15 12:10:32 +00:00
jules
e8af67182d Added method Viewport::recreateScrollbars() 2017-10-06 11:54:55 +01:00
jules
3624df0652 Minor spelling fix 2017-09-25 12:23:25 +01:00
jules
a4f5663fce Added an option for Viewport subclasses to create custom scrollbars. Also modified Viewport::getVerticalScrollBar() and ListBox::getVerticalScrollBar() to return references instead of pointers 2017-09-25 11:22:03 +01:00
jules
eda613c6db Moved all "namespace juce" declarations from module headers to the individual .h and .cpp source files. This makes life a lot easier for Intellisense and other IDE autocompletion tools 2017-09-08 08:59:55 +01:00
hogliux
b5afccc37c Updated file headers and the README with the JUCE 5 license 2017-04-27 14:43:04 +01:00
jules
320c8002da Added methods Viewport::canScrollVertically() and Viewport::canScrollHorizontally() 2017-04-21 12:01:44 +01:00
hogliux
2da1bc5f41 Replace include guards with "#pragma once" 2017-02-01 17:18:07 +00:00
jules
9fa0d49be7 Added an option JUCE_ALLOW_STATIC_NULL_VARIABLES that can be used to turn off dangerous statics like String::empty, var::null, etc. 2016-09-16 12:03:02 +01:00
jules
b6c3add330 Added drag-to-scroll functionality to Viewport 2016-03-02 12:59:47 +00:00
jules
5ca221ee11 Made Viewport remove the old viewed component when setViewedComponent is called, even if it doesn't own it 2016-02-22 10:13:39 +00:00
hogliux
c7b8e77031 Update copyright notice 2015-07-22 15:59:34 +01:00
jules
9b79610cb0 Added a flag MouseWheelEvent::isInertial (currently only implemented for OSX 10.7 or later), and used this to replace some clunky behaviour in the Viewport class that was there to avoid inertial wheel movements triggering nested scrollable components. 2015-06-22 20:28:15 +01:00
jules
a4f5faec2d Fix for a crash when deleting FileBrowserComponent under certain circumstances. 2015-03-24 16:00:58 +00:00
jules
0b67cb2b93 Workaround to avoid misplaced wheel events when scrolling a viewport than contains wheel-able subcomponents. 2014-12-16 16:28:02 +00:00
jules
943d20ba7a Added an option to Viewport to allow mouse-wheel scrolling when scrollbars are disabled. 2014-04-12 21:57:21 +01:00
jules
e9451587ea Added method Viewport::getViewArea() 2014-02-08 11:37:50 +00:00
jules
023b9ac6cc Changed ListBox to pass-on left/right key events. 2013-09-05 15:20:59 +01:00
jules
7f6394478a Stripped out some unnecessary boilerplate includes from juce_gui_basics. 2013-08-24 11:45:55 +01:00
jules
5a1112ab94 Updated the format of the header include guard macros. 2013-07-17 16:26:35 +01:00
jules
5918d039ce Added some "override" annotations. 2013-07-08 19:05:14 +01:00
jules
03c2801f3f Copyright header update in all module files. juce_core modules are now ISC licensed. All other modules are GPLv2/3/AGPLv3 2013-06-13 13:17:12 +01:00
jules
c7506df13f Changed some pass-by-references to pass-by-value to improve compiler optimisation. 2013-05-22 23:05:53 -06:00
jules
1bf9f441e6 Fix for listbox mousewheeling when using select-on-mouse-move mode. 2013-03-30 12:31:49 +00:00
jules
0ceeb573d8 Minor changes to avoid pedantic compiler warnings. 2012-12-04 21:39:15 +00:00
jules
e3537ba57a Cleaned out some defunct ComponentBuilder code. 2012-07-26 15:32:34 +01:00
jules
cd5893d6e8 Removed the Scrollbar's setButtonVisibility method, and instead added LookAndFeel::areScrollbarButtonsVisible() 2012-07-13 13:36:55 +01:00
jules
87175c91f5 Changed the signature of MouseListener::mouseWheelMove() to take a struct MouseWheelDetails rather than raw floats. This will require updates in source code that uses mouse-wheel callbacks, but provides some new abilities, including a flag to indicate inverted wheel direction. 2012-05-25 16:42:36 +01:00
jules
15375dd223 Internal work on the ComponentBuilder system. 2012-01-17 18:33:35 +00:00
jules
cd0683ef4d Tidied up a few return types. 2011-12-11 21:25:53 +00:00
jules
c555cbb9cb Tweaks to Viewport and roundToInt() 2011-10-28 14:17:55 +01:00