Because it is not a open-project, i can not share my complete implementation, and nether will.
BUT
I will share the line algo, that i get somewhere.
AND
i will tell you the fix for the problem, but you will need to think.
This is the function that get 2 Vector2 and plot a line in betwen
IF, you feed the coordenates of the previous input position, and the actual input position
WHEN any of the X or Y values diference if greater then 1
It will plot the correct straight line and it will fix the problem of FastInputDoNotDrawContinuously
func draw_fill_gap(start : Vector2, end : Vector2) -> void:
var dx := int(abs(end.x - start.x))
var dy := int(-abs(end.y - start.y))
var err := dx + dy
var e2 := err << 1
var sx = 1 if start.x < end.x else -1
var sy = 1 if start.y < end.y else -1
var x = start.x
var y = start.y
while !(x == end.x && y == end.y):
e2 = err << 1
if e2 >= dy:
err += dy
x += sx
if e2 <= dx:
err += dx
y += sy
filler(Vector2(x, y))
.About the increasing performance usage when having several lines, i tell you a only a hint, but... ricercare, brother.
You are getting a performance problem, because well, you are computing more and more things when you draw more and more lines
How do you fix that?
You simple does not compute more and more things, you keep your computation static.
You need Godot to work your empty space and filled space the same
You can get that by using some bult-in node.
What built-in node can fill the entire screen, with nothing and with completle noise, and keep the performance the same?
Find that node, and you fix your performance problem. (and create another several problens, that are indeed very boring to fix, but its the work)