diff options
Diffstat (limited to 'source/blender/editors/space_node/node_draw.cc')
-rw-r--r-- | source/blender/editors/space_node/node_draw.cc | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index 2c47883d831..455eceed293 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -1,21 +1,5 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2008 Blender Foundation. - * All rights reserved. - */ +/* SPDX-License-Identifier: GPL-2.0-or-later + * Copyright 2008 Blender Foundation. All rights reserved. */ /** \file * \ingroup spnode @@ -397,7 +381,7 @@ static void node_update_basis(const bContext &C, bNodeTree &ntree, bNode &node, /* Round the socket location to stop it from jiggling. */ nsock->locx = round(loc.x + NODE_WIDTH(node)); - nsock->locy = round(0.5f * (dy + buty)); + nsock->locy = round(dy - NODE_DYS); dy = buty; if (nsock->next) { @@ -527,7 +511,7 @@ static void node_update_basis(const bContext &C, bNodeTree &ntree, bNode &node, nsock->locx = loc.x; /* Round the socket vertical position to stop it from jiggling. */ - nsock->locy = round(0.5f * (dy + buty)); + nsock->locy = round(dy - NODE_DYS); dy = buty - multi_input_socket_offset * 0.5; if (nsock->next) { @@ -626,7 +610,9 @@ static void node_update_hidden(bNode &node, uiBlock &block) static int node_get_colorid(const bNode &node) { - switch (node.typeinfo->nclass) { + const int nclass = (node.typeinfo->ui_class == nullptr) ? node.typeinfo->nclass : + node.typeinfo->ui_class(&node); + switch (nclass) { case NODE_CLASS_INPUT: return TH_NODE_INPUT; case NODE_CLASS_OUTPUT: |