fix: Scale view cube size by device pixel ratio
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
#include "ViewCube.h"
|
||||
#include <QGuiApplication>
|
||||
#include <QPainter>
|
||||
#include <QFont>
|
||||
#include <QOpenGLShaderProgram>
|
||||
#include <QOpenGLTexture>
|
||||
#include <QScreen>
|
||||
#include <QVector>
|
||||
|
||||
ViewCube::ViewCube()
|
||||
@@ -34,7 +36,7 @@ void ViewCube::initializeGL()
|
||||
|
||||
void ViewCube::paintGL(QOpenGLShaderProgram* simpleShader, int simpleShaderColorLoc, const QMatrix4x4& viewMatrix, int width, int height)
|
||||
{
|
||||
int viewCubeSize = 150;
|
||||
int viewCubeSize = 150 * QGuiApplication::primaryScreen()->devicePixelRatio();
|
||||
glViewport(width - viewCubeSize, height - viewCubeSize, viewCubeSize, viewCubeSize);
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user