diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-02-17 08:53:08 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-02-17 08:53:08 +0200 |
commit | 7246b229e136d0fc918b4ac98472fa92114d1a02 (patch) | |
tree | 2ed15da81379a2b1f2e1c3966642131f2f85a57c /scene/main | |
parent | c7aadab155a6e3d3d5445465f3d6eda18a31d2e4 (diff) |
Set RTL minimal dash size to 2.0, add invalid dash size error to the `draw_dashed_line`.
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/canvas_item.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index 1c7d42ad36..b36353158b 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -513,11 +513,12 @@ bool CanvasItem::is_y_sort_enabled() const { void CanvasItem::draw_dashed_line(const Point2 &p_from, const Point2 &p_to, const Color &p_color, real_t p_width, real_t p_dash, bool p_aligned) { ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); + ERR_FAIL_COND(p_dash <= 0.0); float length = (p_to - p_from).length(); Vector2 step = p_dash * (p_to - p_from).normalized(); - if (length < p_dash || step == Vector2() || p_dash <= 0.0) { + if (length < p_dash || step == Vector2()) { RenderingServer::get_singleton()->canvas_item_add_line(canvas_item, p_from, p_to, p_color, p_width); return; } |