devicePixelRatio() support

This commit is contained in:
2023-02-06 19:50:27 +03:00
parent 7c6ca07323
commit 4e02e154c6
17 changed files with 98 additions and 47 deletions

View File

@@ -184,8 +184,8 @@ void RendererSelection::renderSelectionFrame() {
QOpenGLShaderProgram * prog = 0;
if (r->bindShader(Renderer::srSelectionFrame, &prog)) {
QMatrix4x4 mat;
double mrx = r->mouse_rect.x(), mrw = r->mouse_rect.width(), vw = r->view->width();
double mry = r->mouse_rect.y(), mrh = r->mouse_rect.height(), vh = r->view->height();
double mrx = r->mouse_rect.x(), mrw = r->mouse_rect.width(), vw = r->view->pixelWidth();
double mry = r->mouse_rect.y(), mrh = r->mouse_rect.height(), vh = r->view->pixelHeight();
mat.translate(-1. + (mrw + mrx * 2) / vw, 1. - (mrh + mry * 2) / vh, 0.);
mat.scale(mrw / vw, mrh / vh, 0.);
r->initQuad(sel_frame, mat);