fix(renderer): Adjust center block position when using tray

Fixes #551
This commit is contained in:
Michael Carlberg 2017-05-19 17:24:40 +02:00
parent 3f5141bf22
commit 389bae2669
1 changed files with 5 additions and 0 deletions

View File

@ -399,6 +399,11 @@ double renderer::block_x(alignment a) const {
if ((min_pos = block_w(alignment::LEFT))) {
min_pos += BLOCK_GAP;
}
if (m_rect.x > 0) {
base_pos -= (m_bar.size.w - m_rect.width) / 2.0;
} else {
base_pos += (m_bar.size.w - m_rect.width) / 2.0;
}
return std::max(base_pos - block_w(a) / 2.0, min_pos);
}
case alignment::RIGHT: {