Fix unwanted waypoint list transparency
Ticket: https://sourceforge.net/p/flightgear/codetickets/2009/
This commit is contained in:
parent
087995448f
commit
f076fe1c1b
1 changed files with 19 additions and 12 deletions
|
@ -358,6 +358,10 @@ void WaypointList::draw( int dx, int dy )
|
|||
_blink = !_blink;
|
||||
}
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE);
|
||||
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
GLint sx = (int) abox.min[0],
|
||||
sy = abox.min[1];
|
||||
|
@ -371,7 +375,7 @@ void WaypointList::draw( int dx, int dy )
|
|||
|
||||
glScissor(sx + dx, sy + dy, w, h);
|
||||
int row = firstVisibleRow(),
|
||||
final = lastVisibleRow(),
|
||||
finalRow = lastVisibleRow(),
|
||||
rowHeight = rowHeightPx(),
|
||||
y = rowHeight;
|
||||
|
||||
|
@ -381,7 +385,7 @@ void WaypointList::draw( int dx, int dy )
|
|||
|
||||
RoutePath path(_model->flightplan());
|
||||
|
||||
for ( ; row <= final; ++row, y += rowHeight) {
|
||||
for ( ; row <= finalRow; ++row, y += rowHeight) {
|
||||
drawRow(dx, dy, row, y, path);
|
||||
} // of row drawing iteration
|
||||
|
||||
|
@ -399,6 +403,9 @@ void WaypointList::draw( int dx, int dy )
|
|||
glVertex2f(dx + abox.max[0], dy + abox.max[1] - insertY);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
}
|
||||
|
||||
void WaypointList::drawRow(int dx, int dy, int rowIndex, int y,
|
||||
|
|
Loading…
Reference in a new issue