Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/ruisapp/glue/macos/window.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,16 @@ void native_window::set_fullscreen_internal(bool enable)
[this->cocoa_window.window init_stuff];
}

r4::vector2<unsigned> 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];
Expand Down
2 changes: 2 additions & 0 deletions src/ruisapp/glue/macos/window.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ public:
return this->cur_win_dims;
}

r4::vector2<unsigned> get_dims() const noexcept override;

ruis::real get_scale() const noexcept;

ruis::real get_dpi() const noexcept;
Expand Down
Loading