2470 Commits

Author SHA1 Message Date
LA
5c521622c6 整理代码 2026-03-10 21:26:34 +08:00
LA
32904b35c8 新增PERSPECTIVE着色器,为BufferedContainer提供透视旋转的2.5D功能 2026-02-21 13:59:42 +08:00
LA
a2ef94d6e5 同步更新 2025-12-06 17:22:05 +08:00
LA
abd37a6327 备份 2025-11-10 23:17:32 +08:00
LA
9917cba56f 只暂存 2025-11-10 00:26:32 +08:00
LA
3debac3f84 修改配置文件名;屏蔽按键日志;增加虚化渲染管线 2025-11-02 02:40:13 +08:00
Dan Balasescu
27a5d1895b Add transform support 2025-10-27 18:42:56 +09:00
Dan Balasescu
405f61cde2 Add simple grayscale support via BufferedContainer 2025-10-27 18:20:21 +09:00
Bartłomiej Dach
6f194c91c4 Fix incorrect text flow layout with non-left anchors when line breaks at last word of paragraph
Closes https://github.com/ppy/osu/issues/32861.
2025-04-18 20:30:29 +02:00
Dan Balasescu
7df03d4495 Merge pull request #6556 from bdach/we-back-in-the-text-flow-mine
Fix text flow container layout changing after one frame in some cases
2025-03-24 19:23:51 +09:00
Bartłomiej Dach
03d0a3bee0 Fix crash when computing layout of right-anchored autosized text flow
This was failing 10 steps away from the actual problem due to
propagation of weird float values (infinities, NaNs, etc.) The actual
problem was that the offset logic was doing questionable things when the
flow was doing initial autosizing in the X direction. In that case the
maximum width was initialised to `float.MaxValue`, which then in
subsequent calculations got reduced to a very-large-but-finite X
position of everything in the flow, and things just broke.

To circumnavigate that, initialise max size using saner
`float.PositiveInfinity` values (which can be used as markers later),
store the actual widths of the lines rather than the offsets to the
right, and then in the second pass, account for the infinite expansion
due to autosize case by overwriting the max width with the width of the
broadest row.
2025-03-24 09:48:13 +01:00
Bartłomiej Dach
0e0d12f651 Fix inaccurate comment 2025-03-20 14:22:06 +01:00
Bartłomiej Dach
7230f6241d Fix text flow container layout changing after one frame in some cases
Fixes
https://discord.com/channels/90072389919997952/1327149041511043134/1351809773510590494.

Essentially what's happening here is that new lines have weird sizing
rules wherein the height of the new line is relative to the height of
the line preceding it. https://github.com/ppy/osu-framework/pull/6545
broke this because prior to it, the lines responsible for this, namely

	769a5d5803/osu.Framework/Graphics/Containers/TextFlowContainer.cs (L448-L452)

ran in `TextFlowContainer.UpdateAfterChildren()` before the `base` call,
and because `TextFlowContainer` inherited `FillFlowContainer`, changing
the inheritance to composition essentially reordered the call so that
the height set happened *after* `FillFlowContainer`'s layout logic ran,
which is why the layout could be essentially wrong for a frame (with the
new lines having height of zero).

After several hours of trying several hacks to jam this behaviour back
where it should be, I noticed that the entire flow was just broken even
before I started touching it. There were two completely independent
invalidation paths (one in fill flow, one in text flow), and even before
any of my recent  changes, when (ab)using some rarely-used features like
first line indent you could provoke the text flow to start twitching.

So what this does is that it takes the entirety of
`ComputeLayoutPositions()` from fill flow, and adapts it to actually
properly handle all of the features that text flow needs without
post-facto position or margin adjusting hacks.
2025-03-20 14:09:24 +01:00
Dean Herbert
b16256e072 Avoid fill flow layout flipping between floating point precisions 2025-03-20 15:29:14 +09:00
Bartłomiej Dach
c31a481788 Fix text flow container not handling non-1 relative width correctly
Resolves https://github.com/ppy/osu/discussions/32400
2025-03-17 09:21:39 +01:00
Bartłomiej Dach
9df0e9192c Only consider flowing children when performing layout of text flow
Fixes one part of https://github.com/ppy/osu/issues/32348.

The reason this is required is due to the game-side abuse done by
`DrawableLinkCompiler` & co. See the following:

	4633f635a4/osu.Game/Graphics/Containers/LinkFlowContainer.cs (L141-L144)

`FillFlowContainer` performs layout computations on `FlowingChildren`
specifically:

	1ccf0376c4/osu.Framework/Graphics/Containers/FillFlowContainer.cs (L113)

Because of this, if using `Flow.Children` in `TextFlowContainer`, the
`DrawableLinkCompiler` - which was skipped by the inner fill flow - is
now being considered for layout at the text flow level. Text flow sees
that the X position of the compiler is 0 (because it wasn't touched by
the inner fill flow), and thus thinks it must be a line break, which
it's not.

So we use `FlowingChildren` to restore parity.
2025-03-12 13:12:35 +01:00
Bartłomiej Dach
045749d7ed Fix TextFlowContainer not laying text out properly on some TextAnchor settings
- Closes https://github.com/ppy/osu-framework/issues/5084
- Closes https://github.com/ppy/osu-framework/issues/5499
- Closes https://github.com/ppy/osu-framework/issues/2073
- Closes https://github.com/ppy/osu/issues/8580
- Supersedes / closes https://github.com/ppy/osu-framework/pull/5507

You might ask why I'm bothering to try this now. Well, this came up when
I wanted to use text flow for BSS purposes (and forced me to hack around
it), and came up again in https://github.com/ppy/osu/pull/31970, and I'm
sick of it.

The actual fix is taken verbatim from
https://github.com/ppy/osu-framework/pull/5507, it's just restructured
using the idea of a single nested flow taken from
https://github.com/ppy/osu-framework/pull/5507#discussion_r1023426911.

As such:

Co-authored-by: HiddenNode <101936124+HiddenNode@users.noreply.github.com>
2025-03-05 08:00:06 +01:00
Dean Herbert
eb6d97d62d Remove obsoleted removals 2025-02-18 11:40:38 +09:00
Berkan Diler
a8f24f1cde Remove a char[] allocation in SearchContainer.cs 2025-01-19 23:13:10 +01:00
Dean Herbert
8166354560 Change OffsetScrollPosition to take a double
In line with other changes, this should have been switched to `double`.
Also making `virtual` for usage within the beatmap carousel (I need to
extend what this function does for this usage).
2025-01-15 16:49:47 +09:00
Bartłomiej Dach
0e558e2b33 Fix grammar 2025-01-13 10:41:12 +01:00
Dean Herbert
862a68d0f1 Appease codefactor for good measure 2025-01-11 20:53:36 +09:00
Dean Herbert
870cecdefa Add missing xmldoc to new method 2025-01-11 01:24:03 +09:00
Dean Herbert
26c808f8fe Allow implementing a custom application of scroll container's current to content
This allows a point of intercept to distribute `double` values to
children and bypass floating point precision issues.
2024-12-20 18:09:33 +09:00
Dean Herbert
17ef9dc5ea Use double in ScrollContainer for scroll tracking
This is the first step towards supporting scrolling over very large
amounts of content. With this along, the animation already becomes
somewhat smoother (no longer "locking" into place too early) but scroll
content will still look jagged when scrolled too far down.

Fixing actual content requires a small amount of extra implementation on
top of this. To keep things simple this would be up to the consumer to
implement and maintain.

Intended to help fix osu! song select from becoming weird when hundreds
of thousands of beatmaps are loaded.
2024-12-20 18:09:32 +09:00
Huo Yaoyuan
ab9552b4cd Revert change for rule non being enabled 2024-11-28 00:21:36 +08:00
Huo Yaoyuan
b531e25646 Performance improvement for LINQ usages 2024-11-27 23:50:04 +08:00
Huo Yaoyuan
f24f39774f Enable basic performance rules 2024-11-27 23:50:01 +08:00
Dan Balasescu
c383b67b28 Enable NRT for RearrangeableListContainer<> 2024-11-15 17:50:28 +09:00
Dan Balasescu
abd8aab4cd Make RearrangeableListContainer<> only replace differences 2024-11-15 17:48:03 +09:00
Dan Balasescu
23443bfd26 Fix RearrangeableListContainer<> crashing on replacement operations 2024-11-14 19:57:40 +09:00
Dean Herbert
3bab44a584 Make ScrollbarMovementExtent protected 2024-11-11 19:09:37 +09:00
Dean Herbert
23913b726a Allow customising ScrollContainer's scrollbar mapping
For use in osu!.
2024-11-11 17:41:10 +09:00
NebulaDev
024fd0b437 Fix typo 2024-09-10 09:49:20 +12:00
Andrei Zavatski
1b28393038 Don't set renderer blending in composite draw node 2024-08-28 03:30:06 +03:00
Bartłomiej Dach
c532d8a939 Fix tabbable container not checking if its next tab stop is focusable
Closes https://github.com/ppy/osu/issues/29501.
2024-08-20 15:11:22 +02:00
Dean Herbert
b4ed7217c1 Bring back HasFlagsFast
.NET version performs poorly on debug.
2024-08-19 19:40:59 +09:00
Bartłomiej Dach
c2a0ef6f3d Merge branch 'master' into virtual-list-no-fillflow 2024-07-03 13:04:28 +02:00
Bartłomiej Dach
55b11e1921 Remove redundant IndexOf() 2024-07-03 12:32:22 +02:00
Bartłomiej Dach
f5d9690a94 Fix typo 2024-07-03 12:29:46 +02:00
Bartłomiej Dach
b73481e7fe Also assert that data iteration order and drawable iteration order match 2024-07-03 12:19:01 +02:00
Bartłomiej Dach
6ad3c18fc7 Extract methods to centralise row math 2024-07-03 12:18:41 +02:00
Andrei Zavatski
c192359468 Don't create children copy in assert 2024-07-02 19:24:20 +03:00
Andrei Zavatski
c4ea0692e7 Use foreach in visibility update 2024-07-02 19:22:27 +03:00
Andrei Zavatski
674b5f8a40 Simplify rowTop bound
We explicitly define Y on creation, no need to check drawable's load state
2024-07-02 18:53:07 +03:00
Andrei Zavatski
d17082aa26 Fix bounds check on visibility update 2024-07-02 18:49:27 +03:00
Andrei Zavatski
7ca13ea126 Fix correct order assert 2024-07-02 18:26:15 +03:00
Salman Ahmed
c9d46d3a60 Add lenience to scrollbar visibility conditionals 2024-07-02 13:48:47 +03:00
Dan Balasescu
b4aa48697d Remove HasFlagFast 2024-07-02 13:26:53 +09:00
Andrei Zavatski
c9e771a0d6 Invalidate visibility cache only when needed 2024-06-30 01:31:25 +03:00