Commit d0479b98 authored by Alexander Lohnau's avatar Alexander Lohnau 💬 Committed by Nate Graham
Browse files

DRAFT: Fix issues with LayoutManager.insertAtCoordinates

The spacing must be multiplied by two in order to get the correct position

BUG: 444071
parent 3c756d06
......@@ -168,9 +168,14 @@ function insertAtCoordinates(item, x, y) {
if (root.isHorizontal) {
for (var i = 0; i < layout.children.length; ++i) {
var candidate = layout.children[i];
if (x >= candidate.x && x < candidate.x + candidate.width + layout.rowSpacing) {
child = candidate;
break;
// It must be at on the same or a higner x position as the candidate
if (x >= candidate.x) {
// Taking the candidate with & rowSpacing into account, it must be smaller
const totalXofCondidate= candidate.x + candidate.width + layout.rowSpacing * 2
if (x <= totalXofCondidate) {
child = candidate;
break;
}
}
}
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment