Skip to content

Commit 46c2859

Browse files
committed
Fix color stacking
1 parent 01b4a08 commit 46c2859

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/com/reco1l/andengine/component/UIComponent.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -695,27 +695,31 @@ abstract class UIComponent : Entity(0f, 0f),
695695
gl.glPushMatrix()
696696
onApplyTransformations(gl, camera)
697697

698+
ColorStack.pushColor(gl, color, inheritAncestorsColor)
699+
698700
// Render background quad
699701
if (!Precision.almostEquals(backgroundColor.alpha, 0f)) {
700-
QuadRenderer.renderQuad(gl, 0f, 0f, width, height, radius, color = backgroundColor, inheritColors = inheritAncestorsColor)
702+
QuadRenderer.renderQuad(gl, 0f, 0f, width, height, radius, color = backgroundColor, inheritColors = false)
701703
}
702704

703705
// Render component and children
704-
ColorStack.pushColor(gl, color, inheritAncestorsColor)
705706
doDraw(gl, camera)
706707
onDrawChildren(gl, camera)
707708
ColorStack.popColor(gl)
708709

709710
// Render border quad
710711
if (!Precision.almostEquals(borderColor.alpha, 0f) && !Precision.almostEquals(borderWidth, 0f)) {
711-
QuadRenderer.renderQuad(gl, 0f, 0f, width, height, radius, PaintStyle.Outline, borderColor, inheritAncestorsColor, borderWidth)
712+
QuadRenderer.renderQuad(gl, 0f, 0f, width, height, radius, PaintStyle.Outline, borderColor, false, borderWidth)
712713
}
713714

715+
714716
// Debug outline
715717
if (BuildSettings.SHOW_ENTITY_BOUNDARIES) {
716718
QuadRenderer.renderQuad(gl, 0f, 0f, width, height, PaintStyle.Outline, Color4.White, false)
717719
}
718720

721+
ColorStack.pushColor(gl, color, inheritAncestorsColor)
722+
719723
gl.glPopMatrix()
720724
}
721725

0 commit comments

Comments
 (0)