mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-18 21:49:04 -07:00
Support for HiDPI in OpenGL on Linux / GTK3.
wxGTK3 HiDPI support seems to emulate what OSX does quite closely, thus the changes are relatively minimal. Also fixed an ugly rounding issue when populating the ImGUI font map with image thumbnails. Fixes Gtk3 issue on 4k+ screens #4135 Fixes HiDPI screens with Wayland on Fedora 30 cause Plater view to be too small. #3245
This commit is contained in:
@@ -86,6 +86,13 @@ static const size_t VERTEX_BUFFER_RESERVE_SIZE_SUM_MAX = 1024 * 1024 * 128 / 4;
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
||||
#ifdef __WXGTK3__
|
||||
// wxGTK3 seems to simulate OSX behavior in regard to HiDPI scaling support.
|
||||
RetinaHelper::RetinaHelper(wxWindow* window) : m_window(window), m_self(nullptr) {}
|
||||
RetinaHelper::~RetinaHelper() {}
|
||||
float RetinaHelper::get_scale_factor() { return float(m_window->GetContentScaleFactor()); }
|
||||
#endif // __WXGTK3__
|
||||
|
||||
Size::Size()
|
||||
: m_width(0)
|
||||
, m_height(0)
|
||||
@@ -3732,7 +3739,8 @@ void GLCanvas3D::update_ui_from_settings()
|
||||
{
|
||||
m_dirty = true;
|
||||
|
||||
#if ENABLE_RETINA_GL
|
||||
#if __APPLE__
|
||||
// Update OpenGL scaling on OSX after the user toggled the "use_retina_opengl" settings in Preferences dialog.
|
||||
const float orig_scaling = m_retina_helper->get_scale_factor();
|
||||
|
||||
const bool use_retina = wxGetApp().app_config->get("use_retina_opengl") == "1";
|
||||
|
||||
Reference in New Issue
Block a user