From fb6bd8864411ee27db05ceadcb80f690f44e48dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Wed, 12 Jan 2022 12:49:36 +0100 Subject: Revert "BLI: Refactor vector types & functions to use templates" Includes unwanted changes This reverts commit 46e049d0ce2bce2f53ddc41a0dbbea2969d00a5d. --- source/blender/editors/space_node/node_draw.cc | 2 +- source/blender/editors/space_node/node_group.cc | 2 +- source/blender/editors/space_node/node_intern.hh | 5 ++++- source/blender/editors/space_node/node_select.cc | 4 +--- 4 files changed, 7 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/space_node') diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index 2d3c42b16d1..e9a385c525b 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -2452,7 +2452,7 @@ static void frame_node_draw_label(const bNodeTree &ntree, const bool has_label = node.label[0] != '\0'; if (has_label) { BLF_position(fontid, x, y, 0); - BLF_draw(fontid, label, BLF_DRAW_STR_DUMMY_MAX); + BLF_draw(fontid, label, sizeof(label)); } /* draw text body */ diff --git a/source/blender/editors/space_node/node_group.cc b/source/blender/editors/space_node/node_group.cc index 02d68189997..4834ca3174a 100644 --- a/source/blender/editors/space_node/node_group.cc +++ b/source/blender/editors/space_node/node_group.cc @@ -28,9 +28,9 @@ #include "DNA_anim_types.h" #include "DNA_node_types.h" +#include "BLI_float2.hh" #include "BLI_linklist.h" #include "BLI_listbase.h" -#include "BLI_math_vec_types.hh" #include "BLI_string.h" #include "BLI_vector.hh" diff --git a/source/blender/editors/space_node/node_intern.hh b/source/blender/editors/space_node/node_intern.hh index 740d1fbb6f9..0f542734f66 100644 --- a/source/blender/editors/space_node/node_intern.hh +++ b/source/blender/editors/space_node/node_intern.hh @@ -23,7 +23,7 @@ #pragma once -#include "BLI_math_vec_types.hh" +#include "BLI_float2.hh" #include "BLI_vector.hh" #include "BKE_node.h" @@ -43,6 +43,9 @@ struct bNodeLink; struct bNodeSocket; struct wmGizmoGroupType; struct wmKeyConfig; +namespace blender { +struct float2; +} struct wmWindow; /** Temporary data used in node link drag modal operator. */ diff --git a/source/blender/editors/space_node/node_select.cc b/source/blender/editors/space_node/node_select.cc index 803cf38c53a..334ca1f76ee 100644 --- a/source/blender/editors/space_node/node_select.cc +++ b/source/blender/editors/space_node/node_select.cc @@ -111,13 +111,11 @@ static bNode *node_under_mouse_select(bNodeTree &ntree, int mx, int my) static bNode *node_under_mouse_tweak(bNodeTree &ntree, const float2 &mouse) { - using namespace blender::math; - LISTBASE_FOREACH_BACKWARD (bNode *, node, &ntree.nodes) { if (node->type == NODE_REROUTE) { bNodeSocket *socket = (bNodeSocket *)node->inputs.first; const float2 location{socket->locx, socket->locy}; - if (distance(mouse, location) < 24.0f) { + if (float2::distance(mouse, location) < 24.0f) { return node; } } -- cgit v1.2.3