Skip to content

Commit

Permalink
fix a regression when no parameters are passed to the pool get method
Browse files Browse the repository at this point in the history
  • Loading branch information
obiot committed Aug 14, 2024
1 parent 41f16b5 commit 9886e87
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/melonjs/src/math/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -718,10 +718,14 @@ export const colorPool = createPool<
return {
instance: color,
reset(r, g, b, alpha) {
if (typeof r === "number") {
color.setColor(r, g, b, alpha);
if (arguments.length === 0) {
color.setColor();
} else {
color.copy(r as Color | string);
if (typeof r === "number") {
color.setColor(r, g, b, alpha);
} else {
color.copy(r as Color | string);
}
}
},
};
Expand Down

0 comments on commit 9886e87

Please sign in to comment.