Skip to content

Commit b192851

Browse files
committed
Format
1 parent 97729b2 commit b192851

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

lib/src/animation/content/stroke_content.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class StrokeContent extends BaseStrokeContent {
3838
if (_hidden) {
3939
return;
4040
}
41-
paint.color = _colorAnimation.value.withAlpha((paint.color.a * 255).toInt());
41+
paint.color =
42+
_colorAnimation.value.withAlpha((paint.color.a * 255).toInt());
4243
if (_colorFilterAnimation != null) {
4344
paint.colorFilter = _colorFilterAnimation!.value;
4445
}

lib/src/model/layer/solid_layer.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ class SolidLayer extends BaseLayer {
3131
paint.color = _colorAnimation?.value ?? layerModel.solidColor;
3232

3333
var opacity = transform.opacity?.value ?? 100;
34-
var alpha = (parentAlpha /
35-
255.0 *
36-
(backgroundAlpha * opacity / 100.0) *
37-
255.0)
38-
.round();
34+
var alpha =
35+
(parentAlpha / 255.0 * (backgroundAlpha * opacity / 100.0) * 255.0)
36+
.round();
3937
paint.setAlpha(alpha);
4038

4139
if (_colorFilterAnimation != null) {

lib/src/model/layer/text_layer.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ class TextLayer extends BaseLayer {
130130
} else {
131131
strokePaintColor = documentData.strokeColor;
132132
}
133-
_strokePaint.color = strokePaintColor.withValues(alpha: _strokePaint.color.a);
133+
_strokePaint.color =
134+
strokePaintColor.withValues(alpha: _strokePaint.color.a);
134135

135136
var opacity = transform.opacity?.value ?? 100;
136137
var alpha = opacity * 255 / 100 * parentAlpha ~/ 255;

lib/src/parser/gradient_color_parser.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class GradientColorParser {
162162
continue;
163163
}
164164
if (i == colorStopPositions.length - 1 && position >= colorStopPosition) {
165-
return colorStopColors[i].withValues(alpha:opacity);
165+
return colorStopColors[i].withValues(alpha: opacity);
166166
}
167167
// We found the position in which position is between i - 1 and i.
168168
var distanceBetweenColors =
@@ -171,9 +171,9 @@ class GradientColorParser {
171171
var percentage = distanceToLowerColor / distanceBetweenColors;
172172
var upperColor = colorStopColors[i];
173173
var lowerColor = colorStopColors[i - 1];
174-
return GammaEvaluator.evaluate(
175-
percentage, lowerColor.withValues(alpha:1), upperColor.withValues(alpha:1))
176-
.withValues(alpha:opacity);
174+
return GammaEvaluator.evaluate(percentage,
175+
lowerColor.withValues(alpha: 1), upperColor.withValues(alpha: 1))
176+
.withValues(alpha: opacity);
177177
}
178178
throw Exception('Unreachable code.');
179179
}
@@ -182,7 +182,7 @@ class GradientColorParser {
182182
List<double> opacityStopPositions, List<double> opacityStopOpacities) {
183183
if (opacityStopOpacities.length < 2 ||
184184
position <= opacityStopPositions[0]) {
185-
return color.withValues(alpha:opacityStopOpacities[0]);
185+
return color.withValues(alpha: opacityStopOpacities[0]);
186186
}
187187
for (var i = 1; i < opacityStopPositions.length; i++) {
188188
var opacityStopPosition = opacityStopPositions[i];
@@ -202,7 +202,7 @@ class GradientColorParser {
202202
opacity = lerpDouble(
203203
opacityStopOpacities[i - 1], opacityStopOpacities[i], percentage)!;
204204
}
205-
return color.withValues(alpha:opacity);
205+
return color.withValues(alpha: opacity);
206206
}
207207
throw Exception('Unreachable code.');
208208
}

0 commit comments

Comments
 (0)