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

74 commits

Author SHA1 Message Date
reuk
83e5264c86
Formatting: Remove double-dots from comments and other strings 2025-11-18 15:47:42 +00:00
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
Tom Poole
6bf9bb9a2e Add final specifiers in implementation files 2023-10-10 16:12:38 +01:00
reuk
28414a6af8
Global: Avoid floating-point equality checks where possible 2023-04-04 19:55:11 +01:00
Anthony Nicholls
cff722a4af GUI Basics: Refactor juce_gui_basics file structure
- Created a new detail namespace
- Moved shared module implementation details into the detail namespace
- Split dependencies so source files only rely on details in the detail namespace
- Removed all code from the juce_gui_basics.cpp file
2023-03-16 08:53:12 +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
Tom Poole
2ec861d99e Update licensing banners to JUCE 7 2022-05-16 17:55:48 +01:00
Tom Poole
669782cdf4 Viewport: Fix a scrolling bug when internal components have a transform applied 2022-04-27 12:02:10 +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
reuk
c802319241
Viewport: Stop touches on other components from interrupting scrolling
Previously, a touch on a component outside the Viewport would interrupt
and cancel a scroll gesture inside the Viewport.

Now, the Viewport will respond to all drag events from the input source
that started the drag, allowing the Viewport to be scrolled with one
input source while adjusting other controls with another input source.

The FontsDemo is useful for testing this behaviour, as it has two
Viewports on a single screen, along with some other controls.
2021-09-27 15:46:28 +01:00
ed
8d6ba3b54e Accessibility: Use AccessibilityRole::ignored for UI elements that should not be accessible to screen readers but have accessible children 2021-09-07 11:23:17 +01:00
ed
9147a5e535 Accessibility: Ignore Viewport content holder 2021-05-20 18:24:58 +01:00
reuk
394c4fd475 Clang: Fix warnings when building with clang 10 2020-07-01 10:00:43 +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
ed
a54da0b832 Fixed some more typos 2020-01-07 08:53:23 +00:00
ed
5b65b33280 Make sure scrollbar listeners are updated in Viewport::updateVisibleArea() 2019-11-29 10:59:40 +00:00
ed
ecb87a14b0 Enable Viewport drag-to-scroll functionality by default on devices where touch is the primary input method 2019-02-18 11:36:33 +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
Tom Poole
ab863a6dc2 Replaced all usage of ScopedPointer with std::unique_ptr 2018-04-19 20:27:47 +01:00
ed
45698e40b2 Make Viewport::DragToScrollListener more robust and able to cope with the deletion of the original mouseDown event component 2018-04-12 11:05:42 +01:00
hogliux
3ae28b3d54 Viewport: Added the ability to position the scrollbars at the top/left 2018-03-19 14:00:31 +00:00
jules
1a60fa9765 More ScopedPointer/unique_ptr compatibility work 2018-01-10 17:35:08 +00:00
jules
48a5fbd333 Another batch of ScopedPointer cleanups 2018-01-10 14:49:57 +00:00
ed
6568635216 Fixed an unused variable warning in last commit 2017-11-17 17:28:53 +00:00
ed
eb5d4ea0a7 Moved the check for Component viewportIgnoreDragFlag from Viewport::DragToScrollListener::mouseDown and mouseUp to mouseDrag 2017-11-17 17:25:16 +00:00
jules
2dc9316420 Misc ScopedPointer changes to start using reset() and get() rather than assignments and casts (part of an ongoing drift towards more std::unique_ptr compatibility) 2017-11-01 17:41:06 +00:00
Lukasz Kozakiewicz
bbf6053544 Viewport: enable “scroll on drag” mode by default on Android and iOS. 2017-10-19 15:35:33 +02:00
jules
e8af67182d Added method Viewport::recreateScrollbars() 2017-10-06 11:54:55 +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
d105d9418a Added a minimum velocity property to the ContinuousWithMomentum animated position behaviour and increased the minimum velocity of the viewport to avoid some jitter when the viewport animation is close to stand still 2017-08-30 15:53:04 +01:00
hogliux
b5afccc37c Updated file headers and the README with the JUCE 5 license 2017-04-27 14:43:04 +01:00
jules
bf94ab0e4c Made a few minor tweaks to reduce the number of pedantic -Wfloat-equals warnings 2017-04-21 15:09:35 +01:00
jules
320c8002da Added methods Viewport::canScrollVertically() and Viewport::canScrollHorizontally() 2017-04-21 12:01:44 +01:00
ed
0747a7067b Fixed bug with multi-touch in Viewport when drag is blocked and made some methods const 2017-03-29 15:21:32 +01:00
ed
1e7a933543 Added viewportIgnoreDragFlag to Component to indicate that mouse drag events should not move the Component's parent Viewport with drag-to-scroll functionality enabled. 2017-03-28 15:44:49 +01:00
ed
6f9d07abdb Fixed a bug where modal components in a Viewport with setScrollOnDrag enabled hit jassert (numTouches >= 0) when dismissed 2017-02-13 16:02:08 +00:00
hogliux
035f865099 Fix steppy scrolling if the content component of a viewport was transformed 2016-07-20 17:04:55 +01:00
jules
2fe8465482 Added a minor assertion in Viewport. 2016-03-02 18:05:13 +00: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
Timur Doumler
f73c8e0c59 Fixed bug where Viewport::lookAndFeelChanged() would not update its visibleArea if the call changed its scrollBarThickness. 2016-01-25 12:37:25 +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
21fa6e850e Fixed very minor code style imperfection! 2015-03-24 16:58:21 +00:00