mirror of https://github.com/MISP/MISP
Fixed a case that could cause overlapping pivot elements to appear
- The height calculation did not take into account gaps between child elements caused by them having several children. This caused a newly added sibling's children to overlap. Fixed by compensating for the vertical displacement between children when returning the height data.pull/195/head
parent
6d0c26b9d4
commit
77e29f7068
|
@ -292,9 +292,13 @@ class EventsController extends AppController {
|
|||
$temp = 0;
|
||||
$pivot['children'] = array_values($pivot['children']);
|
||||
foreach ($pivot['children'] as $k => $v) {
|
||||
$temp2 = 0;
|
||||
$pivot['children'][$k]['height'] = ($temp+$k)*50;
|
||||
$temp += $this->__arrangePivotVertical($pivot['children'][$k]);
|
||||
if ($temp > $max) $max = $temp;
|
||||
if ($k > 0) {
|
||||
$temp2 = (($pivot['children'][$k]['height'] - $pivot['children'][$k-1]['height'])/50) -1;
|
||||
}
|
||||
if (($temp+$temp2) > $max) $max = ($temp+$temp2);
|
||||
}
|
||||
return $max;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue