ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.7k stars 817 forks source link

Ultrasounds: Gallery Pictures #12987

Open sombraguerrero opened 1 year ago

sombraguerrero commented 1 year ago

Describe the bug

Now that we have mouse picking working on edittexts sufficiently that the gallery links in Ultrasounds work, this exposes the next issue with that SWF where images that are in the expected path structure (see the attached zip) are not being rendered. I can see in the browser dev console from my test bed that the links are triggering, and the images are loading in. I suspect we're not handling the coordinate object passed into loadMovie. ultrasounds.zip ultrasounds_gallery Original site: https://www.ultrasounds.com

Expected behavior

Valid jpegs should render when loaded into the browser via the links.

Affected platform

Self-hosted version

Operating system

Windows 11

Browser

Chromium Edge

Additional information

8/27/23 nightly

n0samu commented 1 year ago

Found it! 😆 image

These lines of code from the forGallery function position the clip in this offscreen location:

    forGpic._x = 670;
    forGpic._y = 18;

The movie uses an onClipEvent(data) function to reposition the clip in the correct location:

onClipEvent(data){
    this._x = -84;
    this._y = 18;
    this._x -= this._width / 2;
    this._y -= this._height / 2;
}

Unfortunately, it seems like Ruffle does not fire onClipEvent(data) / onData for image loads.

sombraguerrero commented 1 year ago

Clever. Silly, but clever.

n0samu commented 1 year ago

It seems like we aren't firing the event for loadMovie at all. Here is a small demonstration: OnClipEventDataTest.zip

sombraguerrero commented 1 year ago

That was my suspicion. I think loadMovie has several overloads we just don't have accounted for.

n0samu commented 1 year ago

Related to #7301.