summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-01-24 18:10:53 +0100
committerGitHub <noreply@github.com>2020-01-24 18:10:53 +0100
commit4dce3427ef5bf93049a3d12fa7f05b732671e274 (patch)
tree65c715f2b0b678f53001ec1fd54e515dd6e6a8e0 /editor
parentd410f5fc80d4149a7e895391a4c42d88b00d1439 (diff)
parentee2f406c73c6a49ce80f54e3bfe30477bc9cda95 (diff)
Merge pull request #35519 from yamgent/wrong-guideline-value
Fix wrong guideline values shown during dragging
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index d3cbf2947e..1d8f3a2bbd 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -2599,14 +2599,14 @@ void CanvasItemEditor::_draw_guides() {
Color text_color = get_color("font_color", "Editor");
text_color.a = 0.5;
if (drag_type == DRAG_DOUBLE_GUIDE || drag_type == DRAG_V_GUIDE) {
- String str = vformat("%d px", xform.affine_inverse().xform(dragged_guide_pos).x);
+ String str = vformat("%d px", Math::round(xform.affine_inverse().xform(dragged_guide_pos).x));
Ref<Font> font = get_font("font", "Label");
Size2 text_size = font->get_string_size(str);
viewport->draw_string(font, Point2(dragged_guide_pos.x + 10, RULER_WIDTH + text_size.y / 2 + 10), str, text_color);
viewport->draw_line(Point2(dragged_guide_pos.x, 0), Point2(dragged_guide_pos.x, viewport->get_size().y), guide_color, Math::round(EDSCALE));
}
if (drag_type == DRAG_DOUBLE_GUIDE || drag_type == DRAG_H_GUIDE) {
- String str = vformat("%d px", xform.affine_inverse().xform(dragged_guide_pos).y);
+ String str = vformat("%d px", Math::round(xform.affine_inverse().xform(dragged_guide_pos).y));
Ref<Font> font = get_font("font", "Label");
Size2 text_size = font->get_string_size(str);
viewport->draw_string(font, Point2(RULER_WIDTH + 10, dragged_guide_pos.y + text_size.y / 2 + 10), str, text_color);