]> sigrok.org Git - pulseview.git/blobdiff - sigview.cpp
Clip signal painting with glScissor
[pulseview.git] / sigview.cpp
index 8461af6e455f37b1182ef9b9bc1a8197ada54d09..dea3cbc1255bc646307cbd39448be239c0982fae 100644 (file)
@@ -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<Signal> 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();