diff --git a/src/ruisapp/glue/macos/window.cxx b/src/ruisapp/glue/macos/window.cxx index b62337a..0605cdf 100644 --- a/src/ruisapp/glue/macos/window.cxx +++ b/src/ruisapp/glue/macos/window.cxx @@ -686,6 +686,16 @@ void native_window::set_fullscreen_internal(bool enable) [this->cocoa_window.window init_stuff]; } +r4::vector2 native_window::get_dims() const noexcept +{ + auto scale = this->get_scale(); + using std::round; + return { + uint(round(this->cur_win_dims.x() * scale)), // + uint(round(this->cur_win_dims.y() * scale)) + }; +} + ruis::real native_window::get_scale() const noexcept { NSScreen* screen = [this->cocoa_window.window screen]; diff --git a/src/ruisapp/glue/macos/window.hxx b/src/ruisapp/glue/macos/window.hxx index 4d4e342..3994331 100644 --- a/src/ruisapp/glue/macos/window.hxx +++ b/src/ruisapp/glue/macos/window.hxx @@ -257,6 +257,8 @@ public: return this->cur_win_dims; } + r4::vector2 get_dims() const noexcept override; + ruis::real get_scale() const noexcept; ruis::real get_dpi() const noexcept;