From: Joel Holdsworth Date: Sat, 7 Jul 2012 07:16:38 +0000 (+0100) Subject: Clip signal painting with glScissor X-Git-Tag: pulseview-0.1.0~325 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=aeed8b418c0e751d7fef6aeaea1347af2077f904;p=pulseview.git Clip signal painting with glScissor --- diff --git a/sigview.cpp b/sigview.cpp index 8461af6e..dea3cbc1 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();