Skip to content

Commit

Permalink
Maybe this will stop the crash in jasp-stats/jasp-issues#2998
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisGoosen committed Nov 8, 2024
1 parent 8c549da commit c684521
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Desktop/qquick/datasetview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,11 +727,14 @@ QQuickItem * DataSetView::createTextItem(int row, int col)
void DataSetView::setTextItemInfo(int row, int col, QQuickItem * textItem)
{
JASPTIMER_SCOPE(DataSetView::setTextItemInfo);

double desiredX = _colXPositions.size() > col ? _colXPositions[col] : 0,
desiredW = _dataColsMaxWidth.size() > col ? _dataColsMaxWidth[col] : 0;

textItem->setHeight(_dataRowsMaxHeight - (2 * _itemVerticalPadding));
textItem->setWidth(_dataColsMaxWidth[col] - (2 * _itemHorizontalPadding));
textItem->setWidth(desiredW - (2 * _itemHorizontalPadding));

textItem->setX(_colXPositions[col] + _itemHorizontalPadding);
textItem->setX(desiredX + _itemHorizontalPadding);
textItem->setY(((row + 1) * _dataRowsMaxHeight) + _itemVerticalPadding);

textItem->setZ(-4);
Expand Down

0 comments on commit c684521

Please sign in to comment.