Skip to content

Commit

Permalink
fix window-scale implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
tsl0922 committed Jan 28, 2023
1 parent a044f1e commit 22ed3f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ void Player::initMpv() {

mpv->observeProperty("window-scale", MPV_FORMAT_DOUBLE, [this](void* data) {
double scale = static_cast<double>(*(double*)data);
int w, h;
glfwGetWindowSize(window, &w, &h);
glfwSetWindowSize(window, (int)(w * scale), (int)(h * scale));
int w = (int)mpv->property<int64_t, MPV_FORMAT_INT64>("dwidth");
int h = (int)mpv->property<int64_t, MPV_FORMAT_INT64>("dheight");
if (w > 0 && h > 0) glfwSetWindowSize(window, (int)(w * scale), (int)(h * scale));
});

mpv->observeProperty("fullscreen", MPV_FORMAT_FLAG, [this](void* data) {
Expand Down

0 comments on commit 22ed3f8

Please sign in to comment.