summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-01-03 13:47:52 +0100
committerGitHub <noreply@github.com>2019-01-03 13:47:52 +0100
commit6b1c3d63106f9ef32ccb42b1f9429742f9a777be (patch)
treefd60993104dec06b698edcb02866a9c8c3d9a502 /scene
parent200be0795d1fc10c2628c00eafc0d276b669301e (diff)
parent574f90605d9b409e9ecdab4d1750fe22acab95c1 (diff)
Merge pull request #24722 from Calinou/improve-graphedit-line-drawing
Make GraphEdit lines smoother and scale their width on hiDPI displays
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/graph_edit.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp
index b4e4f7125d..94c65b3e64 100644
--- a/scene/gui/graph_edit.cpp
+++ b/scene/gui/graph_edit.cpp
@@ -34,6 +34,10 @@
#include "core/os/keyboard.h"
#include "scene/gui/box_container.h"
+#ifdef TOOLS_ENABLED
+#include "editor/editor_scale.h"
+#endif
+
#define ZOOM_SCALE 1.2
#define MIN_ZOOM (((1 / ZOOM_SCALE) / ZOOM_SCALE) / ZOOM_SCALE)
@@ -665,11 +669,15 @@ void GraphEdit::_draw_cos_line(CanvasItem *p_where, const Vector2 &p_from, const
Vector<Color> colors;
points.push_back(p_from);
colors.push_back(p_color);
- _bake_segment2d(points, colors, 0, 1, p_from, c1, p_to, c2, 0, 3, 9, 8, p_color, p_to_color, lines);
+ _bake_segment2d(points, colors, 0, 1, p_from, c1, p_to, c2, 0, 3, 9, 3, p_color, p_to_color, lines);
points.push_back(p_to);
colors.push_back(p_to_color);
+#ifdef TOOLS_ENABLED
+ p_where->draw_polyline_colors(points, colors, Math::floor(2 * EDSCALE), true);
+#else
p_where->draw_polyline_colors(points, colors, 2, true);
+#endif
}
void GraphEdit::_connections_layer_draw() {