summaryrefslogtreecommitdiff
path: root/scene/2d/line_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/line_2d.cpp')
-rw-r--r--scene/2d/line_2d.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/scene/2d/line_2d.cpp b/scene/2d/line_2d.cpp
index f0ab9652b4..229c2c6fe8 100644
--- a/scene/2d/line_2d.cpp
+++ b/scene/2d/line_2d.cpp
@@ -62,6 +62,10 @@ Rect2 Line2D::_edit_get_rect() const {
return aabb;
}
+bool Line2D::_edit_use_rect() const {
+ return true;
+}
+
bool Line2D::_edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const {
const real_t d = _width / 2 + p_tolerance;
@@ -252,12 +256,15 @@ void Line2D::_draw() {
lb.sharp_limit = _sharp_limit;
lb.width = _width;
- lb.build();
-
RID texture_rid;
- if (_texture.is_valid())
+ if (_texture.is_valid()) {
texture_rid = (**_texture).get_rid();
+ lb.tile_aspect = _texture->get_size().aspect();
+ }
+
+ lb.build();
+
VS::get_singleton()->canvas_item_add_triangle_array(
get_canvas_item(),
lb.indices,