Skip to content

Commit

Permalink
Update: Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
AmosHuKe committed Jun 6, 2024
1 parent 98408b2 commit bf59b01
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
3 changes: 1 addition & 2 deletions lib/src/config/tilt_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -617,13 +617,12 @@ class TiltDirection {
if (y > 0) dy = dy > value.dy ? dy : value.dy;
if (x < 0) dx = dx < value.dx ? dx : value.dx;
if (y < 0) dy = dy < value.dy ? dy : value.dy;

/// 符合项
if (x > 0 && x <= value.dx) dx = x;
if (y > 0 && y <= value.dy) dy = y;
if (x < 0 && x >= value.dx) dx = x;
if (y < 0 && y >= value.dy) dy = y;

}
return TiltDirection(dx, dy);
}
Expand Down
24 changes: 12 additions & 12 deletions lib/src/internal/tilt_decoration_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ mixin TiltDecoration {
progressData = switch (direction) {
/// 光源方向计算方式
LightDirection _ => switch (direction) {
LightDirection.none => progressData,
LightDirection.around => constraintsDistance,
LightDirection.all => max,
LightDirection.top => progressY,
LightDirection.bottom => -progressY,
LightDirection.left => progressX,
LightDirection.right => -progressX,
LightDirection.center => max - constraintsDistance,
LightDirection.topLeft => progressX + progressY,
LightDirection.bottomRight => -(progressX + progressY),
LightDirection.topRight => -(progressX - progressY),
LightDirection.bottomLeft => progressX - progressY,
LightDirection.none => progressData,
LightDirection.around => constraintsDistance,
LightDirection.all => max,
LightDirection.top => progressY,
LightDirection.bottom => -progressY,
LightDirection.left => progressX,
LightDirection.right => -progressX,
LightDirection.center => max - constraintsDistance,
LightDirection.topLeft => progressX + progressY,
LightDirection.bottomRight => -(progressX + progressY),
LightDirection.topRight => -(progressX - progressY),
LightDirection.bottomLeft => progressX - progressY,
LightDirection.xCenter =>
max - (progressY < 0.0 ? -progressY : progressY),
LightDirection.yCenter =>
Expand Down

0 comments on commit bf59b01

Please sign in to comment.