Skip to content
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

[Nightly] Casting types for Range.hx and Variant.hx #575

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions haxe/ui/components/Range.hx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private class RangeEnd extends DataBehaviour {
@:access(haxe.ui.core.Component)
private class AllowInteraction extends DefaultBehaviour {
public override function get():Variant {
return (_component._internalEvents != null);
return @:privateAccess Variant.fromBool(_component._internalEvents != null);
}

public override function set(value:Variant) {
Expand Down Expand Up @@ -266,4 +266,4 @@ class RangeBuilder extends CompositeBuilder {
var name = _component.className.split(".").pop();
trace("WARNING: trying to create an instance of '" + name + "' directly, use either 'Horizontal" + name + "' or 'Vertical" + name + "'");
}
}
}
4 changes: 2 additions & 2 deletions haxe/ui/util/Variant.hx
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ abstract Variant(VariantType) from VariantType {
@:op(A * B)
private function multiply(rhs:Variant):Variant {
if (isNumber && rhs.isNumber) {
return toNumber() * rhs.toNumber();
return fromFloat(toNumber() * rhs.toNumber());
}

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

throw "Variant operation error";
Expand Down