Skip to content

Commit d83b35a

Browse files
committed
PenLayer: Fix FBO creation order
1 parent 9033865 commit d83b35a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/penlayer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ void PenLayer::setEngine(libscratchcpp::IEngine *newEngine)
7070

7171
if (m_engine && QOpenGLContext::currentContext()) {
7272
m_projectPenLayers[m_engine] = this;
73-
createFbo();
7473

7574
if (!m_painter)
7675
m_painter = std::make_unique<QNanoPainter>();
@@ -80,6 +79,8 @@ void PenLayer::setEngine(libscratchcpp::IEngine *newEngine)
8079
m_glF->initializeOpenGLFunctions();
8180
}
8281

82+
createFbo();
83+
8384
if (m_vao == 0) {
8485
// Set up VBO and VAO
8586
float vertices[] = { -1.0f, -1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, 0.0f, -1.0f, 1.0f, 0.0f, 1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 1.0f };
@@ -124,8 +125,8 @@ void PenLayer::setHqPen(bool newHqPen)
124125
return;
125126

126127
m_hqPen = newHqPen;
127-
createFbo();
128128
emit hqPenChanged();
129+
createFbo();
129130
}
130131

131132
void scratchcpprender::PenLayer::clear()

0 commit comments

Comments
 (0)