Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avm2: Add AIR Screen API #17608

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Mesteery
Copy link
Contributor

No description provided.

private var _width:int;
private var _height:int;

[API(661)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this needs a versioning, since the entire Screen class is already versioned

return bounds;
}

[API(661)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

import flash.geom.Rectangle;

// [API("733")] Ruffle doesn't support this API Version
[API(661)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this put the versioning in quotes like [API("661")] for consistency with other versioning metadata?

@@ -211,6 +211,10 @@ impl UiBackend for WebUiBackend {
self.update_mouse_cursor();
}

fn get_screens_sizes(&self) -> Vec<(u32, u32)> {
vec![(self.canvas.width(), self.canvas.height())]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about window.screen.width/window.screen.height? https://developer.mozilla.org/en-US/docs/Web/API/Screen/width

@@ -344,6 +348,10 @@ impl UiBackend for NullUiBackend {
Ok(())
}

fn get_screens_sizes(&self) -> Vec<(u32, u32)> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fn get_screens_sizes(&self) -> Vec<(u32, u32)> {
fn get_screen_sizes(&self) -> Vec<(u32, u32)> {

return screens[0];
}

public static native function getScreensInternal():Array;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I believe this method shouldn't be public.
  2. Currently this method is being executed at most once, but the screen configuration may change in time. I'd go with making all methods native and reading always the most recent info (assuming it's what AIR does).

@kjarosh kjarosh added the waiting-on-author Waiting on the PR author to make the requested changes label Aug 31, 2024
@danielhjacobs danielhjacobs added A-avm2 Area: AVM2 (ActionScript 3) T-compat Type: Compatibility with Flash Player labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-avm2 Area: AVM2 (ActionScript 3) air Adobe AIR T-compat Type: Compatibility with Flash Player waiting-on-author Waiting on the PR author to make the requested changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants