public override void draw(Graphics graphics, float parentAlpha) { validate(); if (transform) { applyTransform(graphics, computeTransform()); } if (_firstWidget != null && _firstWidget.isVisible()) { var scissor = ScissorStack.calculateScissors( stage?.camera, graphics.batcher.transformMatrix, _firstWidgetBounds); if (ScissorStack.pushScissors(scissor)) { graphics.batcher.enableScissorTest(true); _firstWidget.draw(graphics, parentAlpha * color.A); graphics.batcher.enableScissorTest(false); ScissorStack.popScissors(); } } if (_secondWidget != null && _secondWidget.isVisible()) { var scissor = ScissorStack.calculateScissors( stage?.camera, graphics.batcher.transformMatrix, _secondWidgetBounds); if (ScissorStack.pushScissors(scissor)) { graphics.batcher.enableScissorTest(true); _secondWidget.draw(graphics, parentAlpha * color.A); graphics.batcher.enableScissorTest(false); ScissorStack.popScissors(); } } _style.handle.draw( graphics, _handleBounds.x, _handleBounds.y, _handleBounds.width, _handleBounds.height, new Color(color, (int)(color.A * parentAlpha))); if (transform) { resetTransform(graphics); } }
public override void draw(Graphics graphics, float parentAlpha) { validate(); if (transform) { applyTransform(graphics, computeTransform()); } if (_firstWidget != null) { //batch.flush(); //getStage().calculateScissors(firstWidgetBounds, firstScissors); //if (ScissorStack.pushScissors(firstScissors)) { if (_firstWidget.isVisible()) { _firstWidget.draw(graphics, parentAlpha * color.A); } //batch.flush(); //ScissorStack.popScissors(); } } if (_secondWidget != null) { //batch.flush(); //getStage().calculateScissors( secondWidgetBounds, secondScissors ); //if( ScissorStack.pushScissors( secondScissors ) ) { if (_secondWidget.isVisible()) { _secondWidget.draw(graphics, parentAlpha * color.A); } //batch.flush(); //ScissorStack.popScissors(); } } _style.handle.draw(graphics, _handleBounds.x, _handleBounds.y, _handleBounds.width, _handleBounds.height, new Color(color, color.A * parentAlpha)); if (transform) { resetTransform(graphics); } }