Commit Graph

12910 Commits

Author SHA1 Message Date
Kamil Jarosz 85c7370577 text: Fix laying out empty text boxes
This patch fixes how empty text boxes are laid out.
The empty boxes are now added during line fixup, and not after,
which ensures they are subjected to alignment and other adjustments.
2024-08-02 17:56:45 +02:00
Kamil Jarosz 8722642ed7 text: Reset max font size on newline
Before this patch, max font size (which claimed to be the highest font
size observed within the current line) was calculated for each span,
regardless of newlines.
2024-08-02 17:56:45 +02:00
Kamil Jarosz fcbeb92406 text: Assume there's at least one layout box
That condition related to drawing a cursor when there are no boxes is
outdated, as currently it's guaranteed that there's at least one box.

FormatSpans.normalize() ensures that there's at least one span, and
LayoutContext.fixup_line() ensures that each line has at least one box.
2024-08-02 17:56:45 +02:00
Kamil Jarosz a9d95e4cb3 tests: Fix avm1/edittext_scroll
This test used device fonts, this patch embeds Noto Sans
and uses it instead.
2024-08-02 17:56:45 +02:00
Kamil Jarosz 2de9fb83b4 text: Ignore non-text boxes when calculating line bounds 2024-08-02 17:07:02 +02:00
Lord-McSweeney 6c233ed859 avm2: Annotate all object *Data structs with `#[repr(C)]`
This ensures that the ScriptObjectData common to every *Data is always at the same offset, which results in better codegen for TObject methods
2024-08-01 09:09:29 -07:00
Lord-McSweeney c54de07382 avm2: Resolve review comments and use `activation.gc()` in some places 2024-08-01 09:09:29 -07:00
Lord-McSweeney 8f6736da74 avm2: Store a `DisplayObject` instead of `Option<DisplayObject>` in `StageObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 3ae53a6ef2 avm2: Use `Gc` instead of `GcCell` in `ScriptObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney c80bd7a55e avm2: Use `Gc` instead of `GcCell` in `FunctionObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 336e10a535 avm2: Use `Gc` instead of `GcCell` in `XmlListObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 2ff8238bf0 avm2: Remove now-unnecessary `Mutation` argument in some LoaderInfo methods 2024-08-01 09:09:29 -07:00
Lord-McSweeney 49188bd5d7 avm2: Use `Gc` instead of `GcCell` in `LoaderInfoObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney fa759a06a4 avm2: Use `Gc` instead of `GcCell` in `EventObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 5ea9b5d80b avm2: Use `Gc` instead of `GcCell` in `SoundChannelObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 458264a76a avm2: Use `Gc` instead of `GcCell` in `SoundObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 4773591c42 avm2: Use `Gc` instead of `GcCell` in `ClassObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 42e0380e2e avm2: Use `Gc` instead of `GcCell` in `DispatchObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney c551a365a3 avm2: Use `Gc` instead of `GcCell` in `PrimitiveObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 64261c8f06 avm2: Use `Gc` instead of `GcCell` in `RegExpObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 562be06fb1 avm2: Use `Gc` instead of `GcCell` in `VectorObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney b1acb17806 avm2: Use `Gc` instead of `GcCell` in `ArrayObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 7e82b3f425 avm2: Use `Gc` instead of `GcCell` in `XmlObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney a9ac849e56 avm2: Use `Gc` instead of `GcCell` in `NamespaceObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney ee4c08cc31 avm2: Use `Gc` instead of `GcCell` in `StageObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 3d80fc16c4 avm2: Use `Gc` instead of `GcCell` in `QNameObject` and `ErrorObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney bc5328892a avm2: Use `Gc` instead of `GcCell` in `BitmapDataObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 27d25a9442 avm2: Remove Mutation parameter from `TObject::as_bytearray_mut` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 313c384d41 avm2: Use `Gc` instead of `GcCell` in `ByteArrayObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney a5d2b613ac avm2: Use `Gc` instead of `GcCell` in `DomainObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 19bf1d7dcb avm2: Use `Gc` instead of `GcCell` in `DictionaryObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney e4499c2ed2 avm2: Use `Gc` instead of `GcCell` in `ProxyObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 86b8f3fe61 avm2: Use `Gc` instead of `GcCell` in `ResponderObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney fb168f46b3 avm2: Use `Gc` instead of `GcCell` in `FontObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 4e15bcb9b7 avm2: Use `Gc` instead of `GcCell` in `LocalConnectionObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 895c13d65b avm2: Use `Gc` instead of `GcCell` in `NetStreamObject` 2024-08-01 09:09:29 -07:00
Kamil Jarosz 70c6a1d629 tests: Add avm2/movieclip_goto_scene_last_frame_label test 2024-07-31 11:32:15 +02:00
Kamil Jarosz a0dbbae96f tests: Add avm2/movieclip_goto_scene_last_frame_int test 2024-07-31 11:32:15 +02:00
sleepycatcoding 5806e6577e debug_ui: Add a tab for AVM2 array contents 2024-07-31 00:47:11 +02:00
Kamil Jarosz c54b1b5b4a desktop: Add View menu 2024-07-30 23:42:39 +02:00
Kamil Jarosz d9d644122b desktop: Add tooltips for scale modes 2024-07-30 23:42:39 +02:00
Kamil Jarosz fae55cd702 desktop: Update translations for scale modes 2024-07-30 23:42:39 +02:00
Kamil Jarosz 3ea4af481d core: Add respect_forced parameter to set_scale_mode 2024-07-30 23:42:39 +02:00
Daniel Jacobs f199a8f740 web: Fix height of Ruffle panic details 2024-07-30 19:37:49 +02:00
Kamil Jarosz ee5dce4c86 core: Use layout lines in screen_position_to_index
This refactor makes it possible for layout boxes in the same line to
have different extents, and it does not change the method's behavior.
2024-07-30 19:28:24 +02:00
Kamil Jarosz 0c1c16671b desktop: Add theme option to preferences 2024-07-30 19:09:51 +02:00
Kamil Jarosz 4ad371da95 desktop: Add watcher for ThemePreference change 2024-07-30 19:09:51 +02:00
Kamil Jarosz 52067658f8 desktop: Add ThemePreference to preferences 2024-07-30 19:09:51 +02:00
Kamil Jarosz 54cc5fe107 desktop: Add ThemePreference enum
ThemePreference represents the user's preference over Ruffle's theme.
2024-07-30 19:09:51 +02:00
Kamil Jarosz 23c27420bd desktop: Remove RuffleEvent::ThemeChanged
This event is no longer needed as theme is now changed synchronously.
2024-07-30 19:09:51 +02:00