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

full screen arena target is stretched off bottom of arena tab #700

Open
cbdmaul opened this issue Apr 4, 2017 · 8 comments
Open

full screen arena target is stretched off bottom of arena tab #700

cbdmaul opened this issue Apr 4, 2017 · 8 comments
Labels

Comments

@cbdmaul
Copy link
Collaborator

cbdmaul commented Apr 4, 2017

screenshot from 2017-04-03 20-13-44

on actual arena it appears correctly. in arena tab it is stretched. this is on linux with low res screens.

@phrack phrack added the bug label Apr 4, 2017
@phrack phrack added this to the 4.0 SBC Support milestone Apr 4, 2017
@phrack
Copy link
Owner

phrack commented Apr 4, 2017

The problem is that the arena tab tries to always fill the width of the tab area with the arena canvas while maintaining the same aspect ratio as the real arena. With some aspect ratios this means that you end up with an arena area that fits the width but is taller than the available space. The only thing to do in this case is probably to just add a vertical scrollbar. The alternatives, which I hate, are don't fill the width (would look awful) or don't maintain the aspect ratio (would make things in the tab look squashed or stretched).

@phrack
Copy link
Owner

phrack commented Apr 4, 2017

Adding a scrollbar definitely solves the problem but at the expense of the scrollbar always being there for reasons I don't really get at the moment.

@cbdmaul
Copy link
Collaborator Author

cbdmaul commented Apr 4, 2017

Can you fit to vertical AND horizontal? Meaning, if width or height is too wide or tall, use that as the maximum and scale the other measurement down.

@phrack
Copy link
Owner

phrack commented Apr 4, 2017

That may be the best option. Sometimes you'll have space on the RHS and other times the bottom, but never both at the same time.

Adding this to the top of ShootOFFController.addNonCameraView works OK but you end up with way more scroll bar than necessary a lot of the time:

		final ScrollPane s = new ScrollPane(content);
		s.setPrefViewportWidth(cameraTabPane.getPrefWidth());
		s.setPrefViewportHeight(cameraTabPane.getPrefHeight());
		s.setHbarPolicy(ScrollBarPolicy.NEVER);

		final Tab viewTab = new Tab(name, s);

@phrack
Copy link
Owner

phrack commented Apr 4, 2017

What I am about to commit tries to fit both ways and it works with my projector and when I manually resize the arena without a projector to try different aspect ratios. God I hope it works on your projector because I really don't like dealing with JavaFX scaling.

Close this issue if it works for you.

@cbdmaul
Copy link
Collaborator Author

cbdmaul commented Apr 5, 2017

poi_4_4

Really close...

@phrack
Copy link
Owner

phrack commented Apr 5, 2017

That's so close I'll give it 20 more minutes but I am accepting the bug if I don't find the problem in that time box.

@phrack
Copy link
Owner

phrack commented Apr 5, 2017

PS. One reason I am willing to accept this if it's not a 20 minute fix is that it's not a new bug. With this kind of thing I always checkout an old tag to see if it's a new problem a diff will show us the cause of. This has been around since the arena tab was added. We never noticed because before it was just cutting off the bottom of a background and all of the backgrounds have bottoms where cutting a bit off is hard to notice. It's only obvious now because this one niche target makes it obvious.

@phrack phrack removed this from the 4.0 SBC Support milestone Apr 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants