Cleanup: nodeToView & nodeFromView usage #105469
|
@ -45,19 +45,8 @@ static void create_transform_data_for_node(TransData &td,
|
||||||
const float dpi_fac)
|
const float dpi_fac)
|
||||||
{
|
{
|
||||||
float locx, locy;
|
float locx, locy;
|
||||||
|
/* Account for parents (nested nodes). */
|
||||||
/* account for parents (nested nodes) */
|
nodeToView(&node, roundf(node.offsetx), roundf(node.offsety), &locx, &locy);
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* use top-left corner as the transform origin for nodes */
|
/* 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. */
|
/* 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[0] /= dpi_fac;
|
||||||
loc[1] /= dpi_fac;
|
loc[1] /= dpi_fac;
|
||||||
|
|
||||||
/* account for parents (nested nodes) */
|
loc[0] -= roundf(node->offsetx);
|
||||||
if (node->parent) {
|
loc[1] -= roundf(node->offsety);
|
||||||
nodeFromView(node->parent,
|
if (const bNode *parent_space = node->parent) {
|
||||||
mod_moder marked this conversation as resolved
Outdated
|
|||||||
loc[0] - roundf(node->offsetx),
|
nodeFromView(parent_space, loc[0], loc[1], &loc[0], &loc[1]);
|
||||||
loc[1] - roundf(node->offsety),
|
|
||||||
&node->locx,
|
|
||||||
&node->locy);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
node->locx = loc[0] - roundf(node->offsetx);
|
|
||||||
node->locy = loc[1] - roundf(node->offsety);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
node->locx = loc[0];
|
||||||
|
node->locy = loc[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* handle intersection with noodles */
|
/* 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