Skip to content

Commit 390a1b0

Browse files
committed
Maybe this will stop the crash in jasp-stats/jasp-issues#2998
1 parent 44b36db commit 390a1b0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Desktop/qquick/datasetview.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -727,11 +727,14 @@ QQuickItem * DataSetView::createTextItem(int row, int col)
727727
void DataSetView::setTextItemInfo(int row, int col, QQuickItem * textItem)
728728
{
729729
JASPTIMER_SCOPE(DataSetView::setTextItemInfo);
730+
731+
double desiredX = _colXPositions.size() > col ? _colXPositions[col] : 0,
732+
desiredW = _dataColsMaxWidth.size() > col ? _dataColsMaxWidth[col] : 0;
730733

731734
textItem->setHeight(_dataRowsMaxHeight - (2 * _itemVerticalPadding));
732-
textItem->setWidth(_dataColsMaxWidth[col] - (2 * _itemHorizontalPadding));
735+
textItem->setWidth(desiredW - (2 * _itemHorizontalPadding));
733736

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

737740
textItem->setZ(-4);

0 commit comments

Comments
 (0)