From 3d260edcdb83f86e458130a87dff2df76e45fd62 Mon Sep 17 00:00:00 2001 From: ispyisail Date: Sat, 26 Sep 2026 21:18:35 +1200 Subject: [PATCH] Cell rulers: line the top ruler up with the columns when the row header is hidden BorderTitleBlock::draw() leaves the row header's room before the first column even when the row header is hidden; insideBorderRect() does not, so the top ruler was one header width out of line on such a folio. Take the first cell's position from the header sizes, as draw() does. Co-Authored-By: Claude Opus 5.5 --- sources/cellruler.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sources/cellruler.cpp b/sources/cellruler.cpp index 61fa98399..b9055e713 100644 --- a/sources/cellruler.cpp +++ b/sources/cellruler.cpp @@ -92,12 +92,15 @@ void CellRuler::paintEvent(QPaintEvent *event) return; } const BorderTitleBlock &border = diagram->border_and_titleblock; - const QRectF inside = border.insideBorderRect(); const QTransform transform = m_view->viewportTransform(); const int count = horizontal ? border.columnsCount() : border.rowsCount(); const qreal cell_size = horizontal ? border.columnsWidth() : border.rowsHeight(); - const qreal first = horizontal ? inside.left() : inside.top(); + //Where BorderTitleBlock::draw() puts the first cell: after the + //other header's room even when that header is hidden, which + //insideBorderRect() does not account for + const qreal first = Diagram::margin + + (horizontal ? border.rowsHeaderWidth() : border.columnsHeaderHeight()); const qreal scale = horizontal ? transform.m11() : transform.m22(); const qreal offset = (horizontal ? transform.dx() : transform.dy()) + m_leading_space; const qreal cell_pixels = cell_size * scale;