Skip to content

Gantt item is not vertically centered on zoom fit with a large row height #63

@arabine

Description

@arabine

How to reproduce the bug:

  • starting with the Gantt Project example, add a "zoom fit" entry in the menu, add the zoomFit() algorithm from the Gant Legend example
  • Change the model of the project to change the row size:
    if (idx.column() == 0) {
        switch (role) {
        case Qt::SizeHintRole:
            return QSize(100, 60);

Fix:

There are two paths to update the Gantt items (which is bad). The faulty path (GraphicsScene::updateItems()) does not take in account the row size:

Replace:

item->updateItem(Span(item->pos().y(), item->rect().height()), idx);

With:

const QModelIndex sidx = summaryHandlingModel()->mapToSource(idx);
Span rg = rowController()->rowGeometry(sidx);
item->updateItem(rg, idx);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions