From c5d011f1e879ff0de54e4e45a719a9a6b8ea48c8 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Tue, 23 Apr 2019 16:41:54 -0400 Subject: [PATCH] Fix rack rail when resizing. Decrease size of rack rail framebuffer. --- src/app/RackWidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/RackWidget.cpp b/src/app/RackWidget.cpp index 7ef33760..a192c117 100644 --- a/src/app/RackWidget.cpp +++ b/src/app/RackWidget.cpp @@ -104,7 +104,10 @@ void RackWidget::draw(const DrawArgs &args) { // Resize and reposition the RackRail to align on the grid. math::Rect railBox; railBox.pos = args.clipBox.pos.div(BUS_BOARD_GRID_SIZE).floor().mult(BUS_BOARD_GRID_SIZE); - railBox.size = args.clipBox.size.div(BUS_BOARD_GRID_SIZE).floor().plus(math::Vec(5, 2)).mult(BUS_BOARD_GRID_SIZE); + railBox.size = args.clipBox.size.div(BUS_BOARD_GRID_SIZE).ceil().plus(math::Vec(1, 1)).mult(BUS_BOARD_GRID_SIZE); + if (!railFb->box.size.isEqual(railBox.size)) { + railFb->dirty = true; + } railFb->box = railBox; RackRail *rail = railFb->getFirstDescendantOfType();