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

37 commits

Author SHA1 Message Date
reuk
b72e43620c
Grid: Fix cell ordering comparison
Previously, the set Comparator behaved the same way, regardless of the
value of columnFirst. This is incorrect; the set should be sorted such
that the final item in the set has the greatest cross-dimension.

There was also an off-by-one error in the result of
getHighestCrossDimension(). The highestCrossDimension data member is
exclusive, but the cell values in the occupiedCells set are inclusive.
We need to add 1 to the maximum cell cross-dimension in order to convert
it to an exclusive value.
2024-11-21 13:42:54 +00:00
reuk
8fa09ae8ab
Grid: Refactor to move columnFirst data member to set Comparator 2024-11-21 13:41:09 +00:00
reuk
d4107836cd
Grid: Convert nonstatic member function to static 2024-11-21 13:41:08 +00:00
Tom Poole
94d98a2b10 Update licensing information 2024-04-16 11:39:35 +01:00
reuk
94ee60041f
Enumerate: Replace some non-ranged loops 2023-10-31 10:57:43 +00:00
Tom Poole
6bf9bb9a2e Add final specifiers in implementation files 2023-10-10 16:12:38 +01:00
Tom Poole
4153d59e39 Formatting 2023-10-02 15:42:20 +01:00
attila
909f6c43d2 Grid: Fix incorrect computation
One issue affected the situation where the provided bounds wouldn't
start at (0, 0). Such bounds are regularly acquired by calling
Rectangle::reduced().

The other issue affected the width calculation of fractional items.
The error wasn't correctly integrated during the computation, and as a
consequence the last fractional element would exhibit all the
accumulated error.
2023-05-04 17:01:02 +02:00
attila
a6761f9eb8 Grid: Ensure that items with absolute sizes will maintain correctly rounded dimensions
Prior to this commit all Grid calculations were carried out using
floating point numbers. The dimensions of all items would then be
rounded with the same function to calculate the integer dimensions used
for Component layout. This resulted in layout solutions where the width
or height of items with dimensions specified using the absolute Px
quantity could differ from the correctly rounded value of these values.

This commit ensures that the width and height of these items are always
correct and their cumulative error in size is distributed among items
with fractional dimensions.
2023-04-26 11:05:53 +02:00
reuk
28414a6af8
Global: Avoid floating-point equality checks where possible 2023-04-04 19:55:11 +01:00
attila
44dd0649fd Grid: Fix layout for very small items
Until this commit Items with a size of 1 could be rounded to
bounds with a size of 0 or 2 due to floating point errors, leading
to slightly too large or disappearing items. The new approach
preserves the size of items.
2022-09-22 18:18:59 +02:00
reuk
7eb99ed8ec
Grid: Avoid hangs when positioning auto-placement items that are too large for the explicit grid
Previously, positioning such an item would hang while trying to find an
appropriate position for the item, because no position in the grid was
suitable, and implicit cells in the layout direction would be added
until a viable position was found.

We now ensure that there are enough cells in the cross direction to hold
each of the auto-placement items before trying to position those items.
2022-06-24 18:53:59 +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
6bc51f97e4
Grid: Avoid crashing in performLayout when the grid contains no items 2021-10-14 12:40:25 +01:00
reuk
c3c171acaf
Grid: Fix behaviour with negative row/column indices
Negative indices should count backwards from the last explicit
row/column number. If the resulting line number would appear before
the first explicit row/column, implicit grid lines should be added
before the first explicit row/column.
2021-09-28 11:31:49 +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
ed
b5214a341e Normalised lambda whitespace 2020-06-05 09:37:56 +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
322069ce27 Grid: Added some methods to help serialisation 2019-09-26 09:55:18 +01:00
ed
f1d3ac227f Fixed some MSVC warnings in Grid 2019-08-30 21:42:36 +01:00
Tom Maisey
1a8d676f5b Respect GridItem min/max width/height 2019-08-30 15:01:33 +01:00
Tom Poole
a12bc32979 Fixed some warnings on the latest compilers 2019-07-26 12:58:04 +01:00
Tom Poole
ff70ebb03e Fixed a layout issue in the Grid class 2019-07-22 12:01:33 +01:00
ed
497a1b3fb7 Added juce_UnitTestCategories.h to replace raw strings used for test categories 2019-04-03 15:10:40 +01:00
ed
f3af250ff7 Tidied up unit test code layout 2019-04-02 11:54:29 +01:00
ed
97e545cd44 Moved the Grid unit tests into juce_Grid.cpp and re-saved all projects 2019-04-02 11:52:44 +01:00
jules
8e91bfabf7 Spelling correction 2018-08-14 09:48:44 +01:00
ed
4af9526ab5 Fixed a bug in Grid where the area calculation could terminate early 2018-06-11 10:38:14 +01:00
ed
40c948826c Added some braces in juce_Grid.cpp to work around a VS2015 compiler bug 2018-04-24 14:46:12 +01:00
jules
121719be69 Added new method Rectangle::toNearestIntEdges(), and used this to improve the Grid layout snapping 2018-04-04 16:43:17 +01:00
jules
d4a7afa73f Replaced some old juce-style sort operations with std::sort and lambdas 2017-11-03 16:35:11 +00: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
88c734d28d Fixed a crash when performing layout on an empty Grid using auto flow and added a few Margin convenience constructors 2017-08-23 14:26:39 +01:00
jules
2bbd2b9785 Added CSS Grid classes 2017-08-01 16:22:19 +01:00