-
-
Notifications
You must be signed in to change notification settings - Fork 918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Update cicd.yml file on flame_3d to match main, rollback color changes #3378
Changes from all commits
8528dfa
cf6a658
a0ef73f
c56610d
c8d81aa
a8c73ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -10,7 +10,7 @@ import 'package:flutter/material.dart'; | |||||
|
||||||
class RayTraceExample extends FlameGame | ||||||
with HasCollisionDetection, TapDetector { | ||||||
Paint paint = BasicPalette.red.withOpacity(0.6).paint(); | ||||||
Paint paint = Paint()..color = Colors.red.withOpacity(0.6); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is copied as is from main - you can fix on a separate PR! |
||||||
bool isClicked = false; | ||||||
|
||||||
Vector2 get origin => canvasSize / 2; | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -13,7 +13,7 @@ class ResizingRectangle extends RectangleComponent { | |||||
void onGameResize(Vector2 size) { | ||||||
super.onGameResize(size); | ||||||
|
||||||
this.size = size * 0.4; | ||||||
this.size = size * .4; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is copied as is from main - you can fix on a separate PR! |
||||||
} | ||||||
} | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,15 +83,12 @@ mixin HasPaint<T extends Object> on Component | |
throw ArgumentError('Opacity needs to be between 0 and 1'); | ||
} | ||
|
||
setColor( | ||
getPaint(paintId).color.withValues(alpha: opacity), | ||
paintId: paintId, | ||
); | ||
setColor(getPaint(paintId).color.withOpacity(opacity), paintId: paintId); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was easier to read with the trailing comma There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is copied as is from main - you can fix on a separate PR! |
||
} | ||
|
||
/// Returns the current opacity. | ||
double getOpacity({T? paintId}) { | ||
return getPaint(paintId).color.a; | ||
return getPaint(paintId).color.opacity; | ||
} | ||
|
||
/// Changes the opacity of the paint. | ||
|
@@ -103,6 +100,11 @@ mixin HasPaint<T extends Object> on Component | |
setColor(getPaint(paintId).color.withAlpha(alpha), paintId: paintId); | ||
} | ||
|
||
/// Returns the current opacity. | ||
int getAlpha({T? paintId}) { | ||
return getPaint(paintId).color.alpha; | ||
} | ||
|
||
/// Shortcut for changing the color of the paint. | ||
void setColor(Color color, {T? paintId}) { | ||
getPaint(paintId).color = color; | ||
|
@@ -116,13 +118,13 @@ mixin HasPaint<T extends Object> on Component | |
} | ||
|
||
@override | ||
double get opacity => paint.color.a; | ||
double get opacity => paint.color.opacity; | ||
|
||
@override | ||
set opacity(double value) { | ||
paint.color = paint.color.withValues(alpha: value); | ||
paint.color = paint.color.withOpacity(value); | ||
for (final paint in _paints.values) { | ||
paint.color = paint.color.withValues(alpha: value); | ||
paint.color = paint.color.withOpacity(value); | ||
} | ||
} | ||
|
||
|
@@ -184,7 +186,7 @@ class _MultiPaintOpacityProvider<T extends Object> implements OpacityProvider { | |
]; | ||
_layerOpacityRatios = target.paintLayersInternal | ||
?.map( | ||
(paint) => paint.color.a / maxOpacity, | ||
(paint) => paint.color.opacity / maxOpacity, | ||
) | ||
.toList(growable: false); | ||
} | ||
|
@@ -204,7 +206,7 @@ class _MultiPaintOpacityProvider<T extends Object> implements OpacityProvider { | |
} | ||
if (includeLayers) { | ||
target.paintLayersInternal?.forEach( | ||
(paint) => maxOpacity = max(paint.color.a, maxOpacity), | ||
(paint) => maxOpacity = max(paint.color.opacity, maxOpacity), | ||
); | ||
} | ||
|
||
|
@@ -224,7 +226,7 @@ class _MultiPaintOpacityProvider<T extends Object> implements OpacityProvider { | |
for (var i = 0; i < (paintLayersInternal?.length ?? 0); ++i) { | ||
paintLayersInternal![i].color = paintLayersInternal[i] | ||
.color | ||
.withValues(alpha: value * _layerOpacityRatios![i]); | ||
.withOpacity(value * _layerOpacityRatios![i]); | ||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is copied as is from main - you can fix on a separate PR!