fix: debugMode should be inherited from parent when mounted (#1469)

This commit is contained in:
Lukas Klingsbo
2022-03-19 16:13:50 +01:00
committed by GitHub
parent 6434829b45
commit e894d20133
6 changed files with 42 additions and 23 deletions

View File

@ -42,9 +42,8 @@ class MultipleShapesExample extends FlameGame
var totalAdded = 1;
while (totalAdded < 100) {
lastToAdd = nextRandomCollidable(lastToAdd, screenHitbox);
final lastBottomRight =
lastToAdd.toAbsoluteRect().bottomRight.toVector2();
if (lastBottomRight.x < size.x && lastBottomRight.y < size.y) {
final lastBottomRight = lastToAdd.toAbsoluteRect().bottomRight;
if (lastBottomRight.dx < size.x && lastBottomRight.dy < size.y) {
add(lastToAdd);
totalAdded++;
} else {
@ -143,7 +142,7 @@ abstract class MyCollidable extends PositionComponent
@override
void render(Canvas canvas) {
if (isDragged) {
final localCenter = (scaledSize / 2).toOffset();
final localCenter = scaledSize.toOffset() / 2;
canvas.drawCircle(localCenter, 5, _dragIndicatorPaint);
}
}