diff --git a/lib/main.dart b/lib/main.dart index 3ba12da1..728046f5 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -39,8 +39,6 @@ void main() async { IPAddressMode.fromIndex(preferences.getInt(PrefKeys.ipAddressMode)); Globals.gridSize = preferences.getInt(PrefKeys.gridSize) ?? Globals.gridSize; - Globals.snapToGrid = - preferences.getBool(PrefKeys.snapToGrid) ?? Globals.snapToGrid; Globals.showGrid = preferences.getBool(PrefKeys.showGrid) ?? Globals.showGrid; Globals.cornerRadius = preferences.getDouble(PrefKeys.cornerRadius) ?? Globals.cornerRadius; @@ -143,7 +141,7 @@ class _ElasticState extends State { version: widget.version, onColorChanged: (color) => setState(() { teamColor = color; - widget.preferences.setInt('team_color', color.value); + widget.preferences.setInt(PrefKeys.teamColor, color.value); }), ), ); diff --git a/lib/services/globals.dart b/lib/services/globals.dart index f3520647..5b0bfdbd 100644 --- a/lib/services/globals.dart +++ b/lib/services/globals.dart @@ -11,7 +11,6 @@ class Globals { static int teamNumber = 353; static int gridSize = 128; static double cornerRadius = 15.0; - static bool snapToGrid = true; static bool showGrid = false; static const double defaultPeriod = 0.1; @@ -28,6 +27,5 @@ class PrefKeys { static String teamColor = 'team_color'; static String gridSize = 'grid_size'; static String cornerRadius = 'corner_radius'; - static String snapToGrid = 'snap_to_grid'; static String showGrid = 'show_grid'; } diff --git a/lib/widgets/draggable_containers/draggable_widget_container.dart b/lib/widgets/draggable_containers/draggable_widget_container.dart index e8a5834a..5d7decfa 100644 --- a/lib/widgets/draggable_containers/draggable_widget_container.dart +++ b/lib/widgets/draggable_containers/draggable_widget_container.dart @@ -112,11 +112,7 @@ class DraggableWidgetContainer extends StatelessWidget { } static double snapToGrid(double value) { - if (Globals.snapToGrid) { - return (value / Globals.gridSize).roundToDouble() * Globals.gridSize; - } else { - return value; - } + return (value / Globals.gridSize).roundToDouble() * Globals.gridSize; } void refresh() {