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

Editor window size content overflows #72

Closed
RohanPunjani opened this issue May 3, 2024 · 5 comments
Closed

Editor window size content overflows #72

RohanPunjani opened this issue May 3, 2024 · 5 comments
Assignees
Labels
bug Something isn't working windows

Comments

@RohanPunjani
Copy link
Contributor

After capturing the GIF, when opening the editor window, the size is not compatible with the content, and the content is overflowed.

GIF 2024-05-03 at 10-23-13 PM

There is a white background by default for anything that is visible outside of bounds of the window

@RohanPunjani RohanPunjani self-assigned this May 3, 2024
@RohanPunjani RohanPunjani added the bug Something isn't working label May 3, 2024
@Pranav2612000
Copy link
Collaborator

@clearlysid Were you able to reproduce this? Or is it a windows only issue?

@clearlysid
Copy link
Collaborator

Seems like a windows-only issue. I can't create it on macOS. I'm pretty sure it has to do with the PhysicalPosition and LogicalPosition being differently handled on both platforms.

@clearlysid clearlysid changed the title Editor Window Size variable, content overflowes Editor window size content overflows May 15, 2024
@RohanPunjani
Copy link
Contributor Author

The height of the editor window is taken by calculating the preview height + tools height. Preview height is the height that was initially received from the encoder while encoding, but the preview video that was been sent is of always of dimension 3840x2160px

Normal 600x400 frame:
image

Normal 400x600 frame:
image

Normal 800x200 frame:
image

@RohanPunjani
Copy link
Contributor Author

A fix for this is to set aspect ratio always as 3840/2160 for windows

let mut aspect_ratio = width as f32 / height as f32;

#[cfg(target_os = "windows")]
{
    aspect_ratio = 3840.00 / 2160.00;
}

let preview_height_adjusted = EDITOR_WIDTH as f32 / aspect_ratio;
let editor_win_height = preview_height_adjusted + TOOLS_HEIGHT as f32;

@RohanPunjani RohanPunjani linked a pull request May 18, 2024 that will close this issue
@RohanPunjani RohanPunjani reopened this Jun 10, 2024
@RohanPunjani
Copy link
Contributor Author

This is how it looks like now:

800 x 200 400 x 600 600 x 400
image image image

The issue was with windows-capture where the encoded video was not with proper frame dimensions, it has been fixed and also been merged now which gives the above result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants