mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-31 10:17:55 +01:00
Fix keyboard splitter adjustment to avoid float boundary issues (resulted in splitter getting stuck at some points).
This commit is contained in:
@@ -477,8 +477,10 @@ namespace Terminal.Gui {
|
||||
/// <returns></returns>
|
||||
private Pos ConvertToPosFactor (Pos p, int parentLength)
|
||||
{
|
||||
int position = p.Anchor (parentLength);
|
||||
return new Pos.PosFactor (position / (float)parentLength);
|
||||
// calculate position in the 'middle' of the cell at p distance along parentLength
|
||||
float position = p.Anchor (parentLength) + 0.5f;
|
||||
|
||||
return new Pos.PosFactor (position / parentLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user