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

Legato and porta type labels deform on maximized window in widescreen #302

Open
ascopes opened this issue Jul 1, 2022 · 0 comments
Open

Comments

@ascopes
Copy link

ascopes commented Jul 1, 2022

Screenshot of the issue screenshot of the issue

Under Windows 10 Professional 21H2 19044.1766 AMD64, maximizing Helm at 3440x1440 (100% scaling in Windows) resolution results in the Legato and Porta-Type labels clipping off the edge of the panel they display within.

This appears to occur regardless of the display height. I am guessing these labels may just have layout boundaries that are slightly misconfigured, since other similar controls on the display seem to not have this issue.


Taking a look at the source code, I spotted what appears to be the code to define this:

dynamic_section.cpp

float space_x = (getWidth() - (knob_width + selector_width + text_width)) / 4.0f;
float space_y = (getHeight() - (knob_width + text_height)) / 2.0f;
float extra_text_space = 2 * (knob_width - text_height) / 3;

portamento_->setBounds(space_x, space_y, knob_width, knob_width);
portamento_type_->setBounds(knob_width + 2 * space_x, space_y + extra_text_space, selector_width, text_height);
legato_->setBounds(knob_width + selector_width + 3 * space_x, space_y + extra_text_space,  text_width, text_height);

In another file, I seem to have spotted a similar thing, but it is configured slightly differently:

voice_section.cpp

float space_x = (getWidth() - (3.0f * knob_width)) / 4.0f;
float space_y = (getHeight() - (knob_width + text_height)) / 2.0f;

polyphony_->setBounds(space_x, space_y, knob_width, knob_width);
pitch_bend_->setBounds(knob_width + 2 * space_x, space_y, knob_width, knob_width);
velocity_track_->setBounds(2 * knob_width + 3 * space_x, space_y, knob_width, knob_width);

My (very uninformed and probably wrong) guess here is that portamento_ is not adding the extra_text_space attribute, but portamento_type_ and legato_ both are, and this might not be necessary? Even if I try to coerce the window to fill to a portrait aspect ratio, I cannot get a situation where that extra_text_space does anything.

Screenshot of window on 1440x2560 monitor (portrait aspect ratio) screenshot of the issue

Would removing that extra_text_space entirely resolve this? If so, I can always put a PR up to fix this?

@ascopes ascopes changed the title Legato and porta type labels deform on maximized window in UWH Legato and porta type labels deform on maximized window in widescreen Jul 1, 2022
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

No branches or pull requests

1 participant