From 15b1e68b7417f82af20fce9c5f7c51dda4585a1a Mon Sep 17 00:00:00 2001 From: avashilling <165050625+avashilling@users.noreply.github.com> Date: Thu, 3 Jul 2025 14:46:16 -0400 Subject: [PATCH] clarify variable names and format code --- .../widgets/word_zoom/new_word_overlay.dart | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/pangea/toolbar/widgets/word_zoom/new_word_overlay.dart b/lib/pangea/toolbar/widgets/word_zoom/new_word_overlay.dart index d2a23282d..0c5dcc945 100644 --- a/lib/pangea/toolbar/widgets/word_zoom/new_word_overlay.dart +++ b/lib/pangea/toolbar/widgets/word_zoom/new_word_overlay.dart @@ -23,8 +23,8 @@ class _NewWordOverlayState extends State AnimationController? _controller; Animation? _xpScaleAnim; Animation? _fadeAnim; - Size size = const Size(0, 0); - Offset position = const Offset(0, 0); + Size cardSize = const Size(0, 0); + Offset cardPosition = const Offset(0, 0); OverlayEntry? _overlayEntry; bool columnMode = false; Widget? get svg => ConstructLevelEnum.seeds.icon(); @@ -70,8 +70,8 @@ class _NewWordOverlayState extends State final cardGlobal = cardBox.localToGlobal(Offset.zero); final overlayGlobal = overlayBox.localToGlobal(Offset.zero); setState(() { - position = cardGlobal - overlayGlobal; - size = cardBox.size; + cardPosition = cardGlobal - overlayGlobal; + cardSize = cardBox.size; }); } } @@ -93,15 +93,15 @@ class _NewWordOverlayState extends State t = t.clamp(0.0, 1.0); } //move starting position as seed grows so it stays centered - final startX = position.dx + size.width / 2 - (37 * scale); - final startY = position.dy + size.height / 2 + 20 - (37 * scale); + final seedSize = 75 * scale * ((!columnMode) ? fade : 1); + final startX = cardPosition.dx + cardSize.width / 2 - seedSize; + final startY = cardPosition.dy + cardSize.height / 2 + 20 - seedSize; //end is top left if column mode (going towards vocab stats) or top right of card otherwise - final endX = (columnMode) ? 0.0 : position.dx + size.width; - final endY = (columnMode) ? 0.0 : position.dy + 30; + final endX = (columnMode) ? 0.0 : cardPosition.dx + cardSize.width; + final endY = (columnMode) ? 0.0 : cardPosition.dy + 30; final currentX = startX * (1 - t) + endX * t; final currentY = startY * (1 - t) + endY * t; //Grows into frame, and then shrinks if going to top right so it matches card seed size - final seedSize = 75 * scale * ((!columnMode) ? fade : 1); return Positioned( left: currentX, @@ -136,8 +136,8 @@ class _NewWordOverlayState extends State return Stack( children: [ Container( - height: size.height, - width: size.width, + height: cardSize.height, + width: cardSize.width, color: Colors.transparent, ), Positioned( @@ -146,8 +146,8 @@ class _NewWordOverlayState extends State top: 50, bottom: 5, child: Container( - height: size.height, - width: size.width, + height: cardSize.height, + width: cardSize.width, color: widget.overlayColor, ), ),