Skip to content

Commit

Permalink
Merge pull request #609 from Jarrio/patch-7
Browse files Browse the repository at this point in the history
Update Variant.hx
  • Loading branch information
ianharrigan authored May 17, 2024
2 parents 41f7691 + a4e0ed0 commit c27ba78
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions haxe/ui/util/Variant.hx
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,11 @@ abstract Variant(VariantType) from VariantType {
@:op(A * B)
private function multiply(rhs:Variant):Variant {
if (isNumber && rhs.isNumber) {
#if (haxe_ver < 5)
return toNumber() * rhs.toNumber();
#else
return fromFloat(toNumber() * rhs.toNumber());
#end
}

throw "Variant operation error";
Expand All @@ -365,7 +369,11 @@ abstract Variant(VariantType) from VariantType {
@:op(A / B)
private function divide(rhs:Variant):Variant {
if (isNumber && rhs.isNumber) {
#if (haxe_ver < 5)
return toNumber() / rhs.toNumber();
#else
return fromFloat(toNumber() / rhs.toNumber());
#end
}

throw "Variant operation error";
Expand Down

0 comments on commit c27ba78

Please sign in to comment.