summaryrefslogtreecommitdiff
path: root/scene/gui/graph_edit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/graph_edit.cpp')
-rw-r--r--scene/gui/graph_edit.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp
index 5a4dacd897..1e444e439d 100644
--- a/scene/gui/graph_edit.cpp
+++ b/scene/gui/graph_edit.cpp
@@ -42,8 +42,13 @@
#define ZOOM_SCALE 1.2
-#define MIN_ZOOM (((1 / ZOOM_SCALE) / ZOOM_SCALE) / ZOOM_SCALE)
-#define MAX_ZOOM (1 * ZOOM_SCALE * ZOOM_SCALE * ZOOM_SCALE)
+// Allow dezooming 8 times from the default zoom level.
+// At low zoom levels, text is unreadable due to its small size and poor filtering,
+// but this is still useful for previewing purposes.
+#define MIN_ZOOM (1 / Math::pow(ZOOM_SCALE, 8))
+
+// Allow zooming 4 times from the default zoom level.
+#define MAX_ZOOM (1 * Math::pow(ZOOM_SCALE, 4))
#define MINIMAP_OFFSET 12
#define MINIMAP_PADDING 5
@@ -824,7 +829,7 @@ void GraphEdit::_bake_segment2d(Vector<Vector2> &points, Vector<Color> &colors,
}
}
-void GraphEdit::_draw_cos_line(CanvasItem *p_where, const Vector2 &p_from, const Vector2 &p_to, const Color &p_color, const Color &p_to_color, float p_width, float p_bezier_ratio = 1.0) {
+void GraphEdit::_draw_cos_line(CanvasItem *p_where, const Vector2 &p_from, const Vector2 &p_to, const Color &p_color, const Color &p_to_color, float p_width, float p_bezier_ratio) {
//cubic bezier code
float diff = p_to.x - p_from.x;
float cp_offset;