Skip to content

Commit

Permalink
Floats are stored as doubles in Variants
Browse files Browse the repository at this point in the history
  • Loading branch information
migueldeicaza committed Jun 12, 2023
1 parent 6e432d1 commit 12b3200
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/SwiftGodot/Variant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,9 @@ extension Float: GodotVariant {
guard from.gtype == .float else {
return nil
}
var value: Float = 0
var value: Double = 0
from.toType(.float, dest: &value)
self.init (value)
self.init (Float (value))
}

public func toVariant () -> Variant { Variant (self) }
Expand All @@ -388,7 +388,7 @@ extension Double {
guard from.gtype == .float else {
return nil
}
var value: Float = 0
var value: Double = 0
from.toType(.float, dest: &value)
self.init (Double (value))
}
Expand Down

0 comments on commit 12b3200

Please sign in to comment.