Round label position to decreate jittering

pull/758/head
Hleb Valoshka 2020-05-30 21:12:36 +03:00
parent 29cc9b0ccf
commit e8f813ab38
1 changed files with 6 additions and 0 deletions

View File

@ -866,6 +866,12 @@ void Renderer::addAnnotation(vector<Annotation>& annotations,
pos.y() * m_modelMatrix(2, 1) +
pos.z() * m_modelMatrix(2, 2);
win.z() = -depth;
// use round to remove precision error (+/- 0.0000x)
// which causes label jittering
float x = round(win.x());
float y = round(win.y());
if (abs(x - win.x()) < 0.001) win.x() = x;
if (abs(y - win.y()) < 0.001) win.y() = y;
Annotation a;
if (!special || markerRep == nullptr)