ruffle-rs / ruffle

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

Homestuck - distortions in prerendered text image #12205

Open MrCheeze opened 1 year ago

MrCheeze commented 1 year ago

Describe the bug

The issue can be seen in this flash: https://mrcheeze.github.io/homestuck-ruffle-tester/#04538 / https://mrcheeze.github.io/homestuck-ruffle-tester/flash/04538.swf

Press the triangle to advance the text up to this point, where the dialogue looks strangely distorted in Ruffle:

image

Note that this is not a text issue, the text is a prerendered image:

image

Strangely, if I resize the player to an odd width, Ruffle renders it correctly.

image

Expected behavior

The dialogue should look like it does in Flash and not distorted.

Affected platform

Desktop app

Operating system

Windows 11

Browser

Mozilla Firefox

Additional information

In both the web version and desktop, the dialogue looks correct if I resize the player/window to an odd width.

MrCheeze commented 1 year ago

The canvas renderer (and no other) renders it correctly regardless of width.

image

MrCheeze commented 1 year ago

As per the debug tools, the position of the graphic is at exactly half a pixel - (248.5, 41) to (600.5, 86). image

EDIT: Issue does not occur if the graphic is at 248.4 or 248.6 -- makes me think it's a rounding mode issue.

MrCheeze commented 1 year ago

Applying pixel snapping when rendering a bitmap shape seems to solve the issue, but I don't know if it's actually correct or not.