From 72e0a68a810f0094f57b424d828ead5903f8f883 Mon Sep 17 00:00:00 2001 From: Gilles Roudiere Date: Tue, 29 Aug 2017 00:19:14 +0200 Subject: Fixes axis badly displayed with high zooming values --- editor/plugins/canvas_item_editor_plugin.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'editor/plugins') diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 9198e80e3a..ccd5011b4e 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2254,8 +2254,9 @@ void CanvasItemEditor::_draw_axis() { Color y_axis_color(0.4, 1.0, 0.4, 0.6); Color area_axis_color(0.4, 0.4, 1.0, 0.4); - VisualServer::get_singleton()->canvas_item_add_line(ci, Point2(h_scroll->get_min(), 0) + transform.get_origin(), Point2(h_scroll->get_max(), 0) + transform.get_origin(), x_axis_color); - VisualServer::get_singleton()->canvas_item_add_line(ci, Point2(0, v_scroll->get_min()) + transform.get_origin(), Point2(0, v_scroll->get_max()) + transform.get_origin(), y_axis_color); + Point2 origin = transform.get_origin(); + VisualServer::get_singleton()->canvas_item_add_line(ci, Point2(0, origin.y), Point2(viewport->get_size().x, origin.y), x_axis_color); + VisualServer::get_singleton()->canvas_item_add_line(ci, Point2(origin.x, 0), Point2(origin.x, viewport->get_size().y), y_axis_color); Size2 screen_size = Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height")); -- cgit v1.2.3