Skip to content

Commit

Permalink
Monitor scaling for menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
kcleal committed Jul 26, 2024
1 parent 7c6f423 commit 7b09a53
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ namespace Menu {
SkRect rect;
SkPath path;
float pad = fonts.overlayHeight;
float v_gap = 5;
float control_box_h = 35;
float v_gap = 3 * monitorScale;
float control_box_h = 18 * monitorScale; //35;
float y = v_gap;
float x = v_gap;
float m_width = 28 * fonts.overlayWidth;
Expand Down Expand Up @@ -344,13 +344,13 @@ namespace Menu {
}
}

void menuMousePos(Themes::IniOptions &opts, Themes::Fonts &fonts, float xPos, float yPos, float fb_height, float fb_width, bool *redraw) {
void menuMousePos(Themes::IniOptions &opts, Themes::Fonts &fonts, float xPos, float yPos, float fb_height, float fb_width, float monitorScale, bool *redraw) {
if (opts.editing_underway) {
return;
}
float pad = fonts.overlayHeight;
float v_gap = 5;
float control_box_h = 35;
float v_gap = 3 * monitorScale; //5;
float control_box_h = 18 * monitorScale; //35;
float y = v_gap;
float x = v_gap;
auto m_height = (float)(pad * 1.5);
Expand Down
2 changes: 1 addition & 1 deletion src/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace Menu {

void drawMenu(SkCanvas *canvas, Themes::IniOptions &opts, Themes::Fonts &fonts, float monitorScale, float fb_width, float fb_height, std::string inputText, int charIndex);

void menuMousePos(Themes::IniOptions &opts, Themes::Fonts &fonts, float xPos, float yPos, float fb_height, float fb_width, bool *redraw);
void menuMousePos(Themes::IniOptions &opts, Themes::Fonts &fonts, float xPos, float yPos, float fb_height, float fb_width, float monitorScale, bool *redraw);

bool menuSelect(Themes::IniOptions &opts);

Expand Down
2 changes: 1 addition & 1 deletion src/plot_controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2199,7 +2199,7 @@ namespace Manager {
Term::printVariantFileInfo(label, mouseOverTileIndex + currentVarTrack->blockStart, out);
}
} else if (mode == SETTINGS) {
Menu::menuMousePos(opts, fonts, (float)xPos_fb, (float)yPos_fb, (float)fb_height, (float)fb_width, &redraw);
Menu::menuMousePos(opts, fonts, (float)xPos_fb, (float)yPos_fb, (float)fb_height, (float)fb_width, monitorScale, &redraw);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/plot_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@ namespace Manager {
fonts.setFontSize(yScaling, monitorScale);
SkRect rect{};
float height_f = fonts.overlayHeight * 2;
float x = 50;
float x = 25 * monitorScale;
SkPaint bg = opts.theme.bgMenu;
float y = fb_height - (fb_height * 0.025);
float y2 = fb_height - (height_f * 2.5);
Expand Down

0 comments on commit 7b09a53

Please sign in to comment.