Fix scaling in CellImage::toImage(), compute size from *screen widget*.

This commit is contained in:
Jean-Paul Chaput 2023-04-13 00:14:12 +02:00
parent 518a376c01
commit b9862ecd5e
1 changed files with 4 additions and 3 deletions

View File

@ -157,8 +157,9 @@ namespace Hurricane {
//int scale = 80 * Cfg::getParamEnumerate("viewer.printer.mode")->asInt();
int scale = (Graphics::isHighDpi()) ? 4 : 2;
_drawingWidth = _cellWidget->width () * scale;
_drawingHeight = _cellWidget->height() * scale;
_drawingWidth = _screenCellWidget->geometry().width () * scale;
_drawingHeight = _screenCellWidget->geometry().height() * scale;
_cellWidget->resize( _drawingWidth, _drawingHeight );
_image = new QImage( _drawingWidth
, _drawingHeight + ((_flags&ShowScale) ? 60 : 0)
@ -188,7 +189,7 @@ namespace Hurricane {
setFitOnAbutmentBox( true );
_cellWidget->fitToContents();
} else {
//_cellWidget->reframe( _screenCellWidget->getVisibleArea() );
_cellWidget->reframe( _screenCellWidget->getVisibleArea() );
}
cerr << " After resize CellWidget: " << _cellWidget->geometry().width() << "x" << _cellWidget->geometry().height() << endl;