From 277faacf8f20101b9fea7218acd0968434966199 Mon Sep 17 00:00:00 2001 From: Erick Zanardo Date: Tue, 30 Jun 2020 22:30:05 -0300 Subject: [PATCH] Some fixes regarding the joystic PR --- doc/examples/joystick/.gitignore | 44 +++++++++++++++++++ doc/examples/joystick/lib/player.dart | 2 +- .../joystick/joystick_directional.dart | 2 +- 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 doc/examples/joystick/.gitignore diff --git a/doc/examples/joystick/.gitignore b/doc/examples/joystick/.gitignore new file mode 100644 index 000000000..f3c205341 --- /dev/null +++ b/doc/examples/joystick/.gitignore @@ -0,0 +1,44 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Exceptions to above rules. +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/doc/examples/joystick/lib/player.dart b/doc/examples/joystick/lib/player.dart index 68eed035b..e70c8ddae 100644 --- a/doc/examples/joystick/lib/player.dart +++ b/doc/examples/joystick/lib/player.dart @@ -12,7 +12,7 @@ class Player extends Component implements JoystickListener { final _greenPaint = Paint()..color = const Color(0xFF00FF00); final double speed = 159; double currentSpeed = 0; - double radAngle; + double radAngle = 0; bool _move = false; Paint _paint; diff --git a/lib/components/joystick/joystick_directional.dart b/lib/components/joystick/joystick_directional.dart index f0fdf940a..4d3aa95c7 100644 --- a/lib/components/joystick/joystick_directional.dart +++ b/lib/components/joystick/joystick_directional.dart @@ -72,7 +72,7 @@ class JoystickDirectional { Offset(margin.left, _screenSize.height - margin.bottom); _backgroundRect = Rect.fromCircle(center: osBackground, radius: size / 2); - Offset osKnob = + final Offset osKnob = Offset(_backgroundRect.center.dx, _backgroundRect.center.dy); _knobRect = Rect.fromCircle(center: osKnob, radius: size / 4);