mousemark: Account for render target scale when creating geometry
This commit is contained in:
parent
b730308e2f
commit
dea0383719
1 changed files with 3 additions and 2 deletions
|
@ -87,6 +87,7 @@ void MouseMarkEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintDa
|
||||||
vbo->reset();
|
vbo->reset();
|
||||||
vbo->setUseColor(true);
|
vbo->setUseColor(true);
|
||||||
vbo->setColor(color);
|
vbo->setColor(color);
|
||||||
|
const auto scale = effects->renderTargetScale();
|
||||||
ShaderBinder binder(ShaderTrait::UniformColor);
|
ShaderBinder binder(ShaderTrait::UniformColor);
|
||||||
binder.shader()->setUniform(GLShader::ModelViewProjectionMatrix, data.projectionMatrix());
|
binder.shader()->setUniform(GLShader::ModelViewProjectionMatrix, data.projectionMatrix());
|
||||||
QVector<float> verts;
|
QVector<float> verts;
|
||||||
|
@ -94,7 +95,7 @@ void MouseMarkEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintDa
|
||||||
verts.clear();
|
verts.clear();
|
||||||
verts.reserve(mark.size() * 2);
|
verts.reserve(mark.size() * 2);
|
||||||
for (const QPoint &p : qAsConst(mark)) {
|
for (const QPoint &p : qAsConst(mark)) {
|
||||||
verts << p.x() << p.y();
|
verts << p.x() * scale << p.y() * scale;
|
||||||
}
|
}
|
||||||
vbo->setData(verts.size() / 2, 2, verts.data(), nullptr);
|
vbo->setData(verts.size() / 2, 2, verts.data(), nullptr);
|
||||||
vbo->render(GL_LINE_STRIP);
|
vbo->render(GL_LINE_STRIP);
|
||||||
|
@ -103,7 +104,7 @@ void MouseMarkEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintDa
|
||||||
verts.clear();
|
verts.clear();
|
||||||
verts.reserve(drawing.size() * 2);
|
verts.reserve(drawing.size() * 2);
|
||||||
for (const QPoint &p : qAsConst(drawing)) {
|
for (const QPoint &p : qAsConst(drawing)) {
|
||||||
verts << p.x() << p.y();
|
verts << p.x() * scale << p.y() * scale;
|
||||||
}
|
}
|
||||||
vbo->setData(verts.size() / 2, 2, verts.data(), nullptr);
|
vbo->setData(verts.size() / 2, 2, verts.data(), nullptr);
|
||||||
vbo->render(GL_LINE_STRIP);
|
vbo->render(GL_LINE_STRIP);
|
||||||
|
|
Loading…
Reference in a new issue