Skip to content

Commit 8ca5fba

Browse files
committed
[glpainter] use GL_LINE_LOOP for box border
It is more direct usage of line drawings in GL instead of using `glRectd` with disabled polygon drawing
1 parent 6189424 commit 8ca5fba

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

graf3d/gl/src/TGLPadPainter.cxx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -441,11 +441,12 @@ void TGLPadPainter::DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2,
441441

442442
if (mode == kHollow) {
443443
const Rgl::Pad::LineAttribSet lineAttribs(kTRUE, 0, fLimits.GetMaxLineWidth(), kTRUE, &GetAttLine());
444-
//
445-
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
446-
glRectd(x1, y1, x2, y2);
447-
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
448-
glLineWidth(1.f);
444+
glBegin(GL_LINE_LOOP);
445+
glVertex2d(x1, y1);
446+
glVertex2d(x2, y1);
447+
glVertex2d(x2, y2);
448+
glVertex2d(x1, y2);
449+
glEnd();
449450
} else {
450451
const Rgl::Pad::FillAttribSet fillAttribs(fSSet, kFALSE, &fGlFillAtt);//Set filling parameters.
451452
glRectd(x1, y1, x2, y2);

0 commit comments

Comments
 (0)