fix canvas on hdpi

This commit is contained in:
2019-05-17 00:37:35 +02:00
parent f6187b7f86
commit c4cf0c7e47
5 changed files with 13 additions and 10 deletions

View File

@@ -243,7 +243,7 @@ void CanvasModePen::on_Draw(const glm::mat4& ortho, const glm::mat4& proj, const
}
}
glm::u8vec4 pixel;
glReadPixels(pos.x, App::I.height - pos.y - 1, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixel);
glReadPixels(pos.x / App::I.zoom, (App::I.height - pos.y - 1) / App::I.zoom, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixel);
bool outline = glm::min(tip_scale.x, tip_scale.y) < 20 || m_resizing ? false : m_draw_outline;
ShaderManager::u_int(kShaderUniform::DrawOutline, outline);
ShaderManager::u_vec4(kShaderUniform::Col, outline ? glm::vec4(1.f - glm::vec3(pixel) / 255.f, 1.f) : tip_color);