From aeed8b418c0e751d7fef6aeaea1347af2077f904 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 7 Jul 2012 08:16:38 +0100 Subject: [PATCH] Clip signal painting with glScissor --- sigview.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sigview.cpp b/sigview.cpp index 8461af6..dea3cbc 100644 --- a/sigview.cpp +++ b/sigview.cpp @@ -86,6 +86,8 @@ void SigView::paintEvent(QPaintEvent *event) glClear(GL_COLOR_BUFFER_BIT); // Plot the signal + glEnable(GL_SCISSOR_TEST); + glScissor(LabelMarginWidth, 0, width(), height()); offset = RulerHeight; BOOST_FOREACH(const shared_ptr s, sigs) { @@ -99,6 +101,8 @@ void SigView::paintEvent(QPaintEvent *event) offset += SignalHeight; } + glDisable(GL_SCISSOR_TEST); + // Prepare for QPainter rendering glMatrixMode(GL_MODELVIEW); glPopMatrix(); -- 2.30.2