mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-13 11:20:19 +08:00
Small fixes and nits to make null-safe simpler (#686)
This commit is contained in:
@@ -17,18 +17,12 @@ class MyGame extends BaseGame
|
||||
with MultiTouchTapDetector, MultiTouchDragDetector {
|
||||
final _whitePaint = BasicPalette.white.paint;
|
||||
|
||||
Paint _paint;
|
||||
|
||||
final Map<int, Rect> _taps = {};
|
||||
|
||||
Vector2 _start;
|
||||
Vector2 _end;
|
||||
Rect _panRect;
|
||||
|
||||
MyGame() {
|
||||
_paint = _whitePaint;
|
||||
}
|
||||
|
||||
@override
|
||||
void onTapDown(int pointerId, TapDownDetails details) {
|
||||
_taps[pointerId] = Rect.fromLTWH(
|
||||
@@ -83,11 +77,11 @@ class MyGame extends BaseGame
|
||||
void render(Canvas canvas) {
|
||||
super.render(canvas);
|
||||
_taps.values.forEach((rect) {
|
||||
canvas.drawRect(rect, _paint);
|
||||
canvas.drawRect(rect, _whitePaint);
|
||||
});
|
||||
|
||||
if (_panRect != null) {
|
||||
canvas.drawRect(_panRect, _paint);
|
||||
canvas.drawRect(_panRect, _whitePaint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user