mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-24 18:43:37 +00:00
Fix display of caret completion indicator
The zooming algorithm based on caret width was deeply flawed. It is not replaced with a formula based on caret height. Fixes bug #12000.
This commit is contained in:
parent
b6c5603ab0
commit
310c94c48c
@ -79,8 +79,6 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
int const TabIndicatorWidth = 3;
|
|
||||||
|
|
||||||
#undef KeyPress
|
#undef KeyPress
|
||||||
#undef NoModifier
|
#undef NoModifier
|
||||||
|
|
||||||
@ -165,13 +163,14 @@ public:
|
|||||||
// draw completion triangle
|
// draw completion triangle
|
||||||
if (completable) {
|
if (completable) {
|
||||||
int const m = y + dim.height() / 2;
|
int const m = y + dim.height() / 2;
|
||||||
int const d = TabIndicatorWidth * dim.wid - 1;
|
int const d = dim.height() / 8;
|
||||||
// offset for slanted carret
|
// offset for slanted carret
|
||||||
int const sx = (dim.asc - (dim.height() / 2 - d)) * slope;
|
int const sx = (dim.asc - (dim.height() / 2 - d)) * slope;
|
||||||
painter.drawLine(xx + dir * (dim.wid + 1) + sx, m - d,
|
painter.setPen(QPen(color, dim.width()));
|
||||||
xx + dir * (dim.wid + d + 1) + sx, m);
|
painter.drawLine(xx + dir * dim.wid + sx, m - d,
|
||||||
painter.drawLine(xx + dir * (dim.wid + 1) + sx, m + d,
|
xx + dir * (dim.wid + d) + sx, m);
|
||||||
xx + dir * (dim.wid + d + 1) + sx, m);
|
painter.drawLine(xx + dir * dim.wid + sx, m + d,
|
||||||
|
xx + dir * (dim.wid + d) + sx, m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user