Resolve issue with constants in Swift

By making the (inferred type) Double constants an explicit CGFloat
type, they can be used as expected.