X Tutup
Skip to content

Commit 4a5fe73

Browse files
authored
Use float explicitly for perspective lines to avoid precision loss (#1450)
I was working with the perspective editor and noticed the perspective line didn't follow the mouse very well, it jumped large increments when far from the vanishing point. After a bit of investigation, I noticed rad_to_deg was losing precision because `angle` was implicitly an integer. Explicitly typing it as a float fixes the issue
1 parent 972409e commit 4a5fe73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/UI/PerspectiveEditor/PerspectiveLine.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ extends Line2D
44
const LINE_WIDTH := 2
55
const CIRCLE_RAD := 4
66

7-
var angle := 0
8-
var length := 19999
7+
var angle: float = 0.0
8+
var length: float = 19999.0
99

1010
var is_hidden := false
1111
var has_focus := false

0 commit comments

Comments
 (0)
X Tutup