Skip to content

Commit 81dc992

Browse files
committed
PenLayer: Add missing FBO check to setEngine()
1 parent d0daf6f commit 81dc992

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/penlayer.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,15 @@ void PenLayer::setEngine(libscratchcpp::IEngine *newEngine)
102102
m_glF->glBindBuffer(GL_ARRAY_BUFFER, 0);
103103
}
104104

105-
beginFrame();
105+
bool wasBound = m_fbo->isBound();
106+
107+
if (wasBound)
108+
beginFrame();
109+
106110
clear();
107-
endFrame();
111+
112+
if (wasBound)
113+
endFrame();
108114
}
109115

110116
emit engineChanged();

0 commit comments

Comments
 (0)