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 <noreply@anthropic.com>
This commit is contained in:
ispyisail
2026-09-26 21:18:35 +12:00
parent 1e74bcd9de
commit 3d260edcdb
+5 -2
View File
@@ -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;