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

(Menu Widgets) Add scaling #10114

Merged
merged 3 commits into from Feb 14, 2020
Merged

Conversation

jdgleaver
Copy link
Contributor

Description

This PR adds automatic scaling of menu widgets

  • For XMB, the scaling is resolution based (since that's how XMB itself is scaled)

  • For all other menu drivers, the scaling is DPI based

Scaling is adjusted via the regular Menu Scale Factor setting under User Interface > Appearance (for RGUI, this setting is called Menu Widget Scale Factor, since RGUI does not scale as other drivers do!).

NOTE: Dynamic scaling of queued message widgets doesn't really work, since this is hard and very annoying to deal with - and moreover, any existing queued messages generally disappear rapidly enough that small glitches are not an issue. Permanent notifiers do scale in real-time, though, and of course: any newly pushed messages will use the current scale factor.

Reviewers

@natinusala

@@ -289,10 +289,16 @@ static unsigned libretro_message_width = 0;
static char libretro_message[LIBRETRO_MESSAGE_SIZE] = {'\0'};

/* Metrics */
#define BASE_FONT_SIZE 32.0f
#define OZONE_SIDEBAR_WIDTH 408
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe don't duplicate this in both menu widgets and ozone?

… kept in sync between menu_widgets.c and ozone.h
@inactive123
Copy link
Contributor

After some testing, I think an override setting might be necessary.

Here's how it could work - it would look like the 'Menu Scale Factor', except instead of showing '1.00x' by default it would show 'Off'. 'Off' would mean that it scales with the menu scale factor.

The possible values other than 'Off' would be a a dropdown list that has the same possibilities as Menu Scale Factor. If set to any other value other than the default 'Off', it would apply this override for widgets.

Of course, the value 'Off' is only for presentation - if you're going to implement this as a float value, you can come up with some other value, as long as the representation later on shows it as 'off' in the menu.

You'd place this setting in Onscreen Display -> Onscreen Notifications

@jdgleaver
Copy link
Contributor Author

Okay, just pushed a substantial update with many internal changes...

  • Widget scale can now be set independently of menu scale via two new options under Onscreen Display > Onscreen Notifications: Auto Scale Menu Widgets (uses menu scale when enabled) and Menu Widget Scale Override (used when Auto Scale Menu Widgets is false)

  • Ozone scale capping is now internal to menu_driver's menu_display_get_pixel_scale() and menu_display_get_dpi_scale() functions - i.e. all special handling is in one place, so we can use scaling everywhere (menu, widgets, input pointer handling) without any special considerations.

  • Ozone smooth ticker text animations now use DPI scaling (instead of a hard-coded multiplier)

  • Bug fix: Widget FPS text can no longer be clipped off the left hand edge of the screen

I had to change a lot of established code to make this work - testing would be appreciated...

@inactive123 inactive123 merged commit 136163b into libretro:master Feb 14, 2020
@jdgleaver jdgleaver deleted the widget-scaling branch February 14, 2020 17:57
@wisepass2000
Copy link

wisepass2000 commented May 18, 2020

The new widgets are great, but I have a problem with scaling when using on my CRT screen via a RGB-pi.
The Widgets appear squashed and unreadable. I suspect this is because I'm using "super resolution" on my CRT as I suspect many do - for me 1536x240.

If there a possibility to please correct for this by adding a horizontal scaling factor? or another setting I should be looking at ?

FYI - My menu initially also appeared squashed (though the game was fine) I was able to correct this within Settings -> User Interface -> Appearance - "Lock Aspect Ratio" to OFF
rgui_aspect_ratio_lock = "0" in retroarch.cfg

IMG_7894

@vagrant-17
Copy link

vagrant-17 commented May 17, 2021

The new widgets are great, but I have a problem with scaling when using on my CRT screen via a RGB-pi.
The Widgets appear squashed and unreadable. I suspect this is because I'm using "super resolution" on my CRT as I suspect many do - for me 1536x240.

If there a possibility to please correct for this by adding a horizontal scaling factor? or another setting I should be looking at ?

FYI - My menu initially also appeared squashed (though the game was fine) I was able to correct this within Settings -> User Interface -> Appearance - "Lock Aspect Ratio" to OFF
rgui_aspect_ratio_lock = "0" in retroarch.cfg

I use 2560 super resolutions and of course the widgets/notifications appear even more compressed.
Horizontal scaling or similar solution would be very much welcome 👍

@Daddu3
Copy link

Daddu3 commented Sep 27, 2021

Thirding here as an user of 2560x240 Super-Res from my RA to 21" Trinitron-CRT via Ultimate Scart Adapter to mini-Displayport VGA adapter. Being able to adjust horizontal and vertical positions of graphical widgets on top of scaling would be very welcome.

tumblr_4d99d22c53247ea3d31b02718a6f739f_85795ca8_1280

@IzzIsHOr
Copy link

IzzIsHOr commented Aug 22, 2022

No fix for this yet, can't seem to find a way to scale the notifications horizontally. CRTswitchres 2560 Super Res

@mistikkmodels
Copy link

Any FIX for compressed notifications with superres¿??

@MessiahMozgus
Copy link

wow, this was never fixed? I'm on Pi3 with VGA to YPBPR, super res 240p setup. The widgets look awful like above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants