Issue:
The Transform2D * operator does not catch the type of a variable, but will handle an inline Vector2.
My suspicion is the order the * overloads are setup is causing some issue for handling the overload. there is a bug with the current version of Swift (5.9.0.128.108)
Minimum Setup:
import SwiftGodot
@Godot
class ExampleNode: Node2D {
override func _ready() {
if Engine.isEditorHint() { return }
if let viewport = getViewport() {
let size: Vector2 = Vector2(x: 0, y: 0)
// Fails
var first = viewport.getScreenTransform() * getGlobalTransformWithCanvas() * size
// Works
var second =
viewport.getScreenTransform() * getGlobalTransformWithCanvas()
* Vector2(x: size.x, y: size.y)
// Works
var canvasTransformed = viewport.getScreenTransform() * getGlobalTransformWithCanvas()
var third = canvasTransformed * size
}
}
}
Result:
error: cannot convert value of type 'Vector2' to expected argument type 'Transform2D'
viewport.getScreenTransform() * getGlobalTransformWithCanvas() * size
``
Issue: The Transform2D
*
operator does not catch the type of a variable, but will handle an inlineVector2
.My suspicion is the order the
*
overloads are setup is causing some issue for handling the overload. there is a bug with the current version of Swift (5.9.0.128.108)Minimum Setup:
Result: