Cleanup: nodeToView & nodeFromView usage #105469
|
@ -45,19 +45,8 @@ static void create_transform_data_for_node(TransData &td,
|
|||
const float dpi_fac)
|
||||
{
|
||||
float locx, locy;
|
||||
|
||||
/* account for parents (nested nodes) */
|
||||
if (node.parent) {
|
||||
nodeToView(node.parent,
|
||||
node.locx + roundf(node.offsetx),
|
||||
node.locy + roundf(node.offsety),
|
||||
&locx,
|
||||
&locy);
|
||||
}
|
||||
else {
|
||||
locx = node.locx + roundf(node.offsetx);
|
||||
locy = node.locy + roundf(node.offsety);
|
||||
}
|
||||
/* Account for parents (nested nodes). */
|
||||
nodeToView(&node, roundf(node.offsetx), roundf(node.offsety), &locx, &locy);
|
||||
|
||||
/* use top-left corner as the transform origin for nodes */
|
||||
/* Weirdo - but the node system is a mix of free 2d elements and DPI sensitive UI. */
|
||||
|
@ -246,18 +235,14 @@ static void flushTransNodes(TransInfo *t)
|
|||
loc[0] /= dpi_fac;
|
||||
loc[1] /= dpi_fac;
|
||||
|
||||
/* account for parents (nested nodes) */
|
||||
if (node->parent) {
|
||||
nodeFromView(node->parent,
|
||||
loc[0] - roundf(node->offsetx),
|
||||
loc[1] - roundf(node->offsety),
|
||||
&node->locx,
|
||||
&node->locy);
|
||||
}
|
||||
else {
|
||||
node->locx = loc[0] - roundf(node->offsetx);
|
||||
node->locy = loc[1] - roundf(node->offsety);
|
||||
loc[0] -= roundf(node->offsetx);
|
||||
loc[1] -= roundf(node->offsety);
|
||||
if (const bNode *parent_space = node->parent) {
|
||||
mod_moder marked this conversation as resolved
Outdated
|
||||
nodeFromView(parent_space, loc[0], loc[1], &loc[0], &loc[1]);
|
||||
}
|
||||
|
||||
node->locx = loc[0];
|
||||
node->locy = loc[1];
|
||||
}
|
||||
|
||||
/* handle intersection with noodles */
|
||||
|
|
Loading…
Reference in New Issue
The second
parent_space != nullptr
is unnecessary here in C++ as far as I knowI do this for greater clarity, but yes, we can consider it redundant