### Godot version

3.5.1 custom build

### System information

N/A

### Issue description

When using Line2D, I noticed a discrepancy with UVs depending on the end cap mode.

Here are some examples using a tiled repeating texture:

### No capping ✔️ 
![image](https://user-images.githubusercontent.com/95356449/218230984-e5d507d4-7af7-4967-aee7-79c8daa206ff.png)

### Begin cap: Box ✔️ 
![image](https://user-images.githubusercontent.com/95356449/218231092-311370cc-7ff8-4699-976b-c4581eaada0a.png)

### End cap: Box ❌ 
![image](https://user-images.githubusercontent.com/95356449/218231131-00ddf4f7-2a9a-4740-a445-a8601ab026e1.png)


### Steps to reproduce

Create a Line2D
Add a texture with repeating enabled
Set end cap mode to Box

### Minimal reproduction project

not needed, bugfix pr incoming
#include "line_builder.h"
enum SegmentIntersectionResult {
	SEGMENT_PARALLEL = 0,
	SEGMENT_NO_INTERSECT = 1,
	SEGMENT_INTERSECT = 2
};
static SegmentIntersectionResult segment_intersection(
		Vector2 a, Vector2 b, Vector2 c, Vector2 d,
		Vector2 *out_intersection) {
	
	Vector2 cd = d - c;
	Vector2 ab = b - a;
	float div = cd.y * ab.x - cd.x * ab.y;
	if (Math::abs(div) > 0.001f) {
		float ua = (cd.x * (a.y - c.y) - cd.y * (a.x - c.x)) / div;
		float ub = (ab.x * (a.y - c.y) - ab.y * (a.x - c.x)) / div;
		*out_intersection = a + ua * ab;
		if (ua >= 0.f && ua <= 1.f &&
				ub >= 0.f && ub <= 1.f) {
			return SEGMENT_INTERSECT;
		}
		return SEGMENT_NO_INTERSECT;
	}
	return SEGMENT_PARALLEL;
}
static float calculate_total_distance(const Vector<Vector2> &points) {