Skip to content

Commit

Permalink
fix FS#2516 - Screen-based Linetypes issues with pixel based line widths
Browse files Browse the repository at this point in the history
  • Loading branch information
qcad committed Jan 17, 2024
1 parent ebae6f7 commit e1eee34
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/gui/RGraphicsSceneQt.cpp
Expand Up @@ -169,8 +169,14 @@ bool RGraphicsSceneQt::beginPath() {
else {
// screen based line weights:
localPen.setCosmetic(true);
// magic number 4.25 to scale approximately, so 1mm width is 1mm on screen:
localPen.setWidth(RUnit::convert(currentPen.widthF(), document->getUnit(), RS::Millimeter)*4.25);

if (pixelWidth) {
localPen.setWidth(currentPen.width());
}
else {
// magic number 4.25 to scale approximately, so 1mm width is 1mm on screen:
localPen.setWidth(RUnit::convert(currentPen.widthF(), document->getUnit(), RS::Millimeter)*4.25);
}
}
}
currentPainterPath.setPen(localPen);
Expand Down

0 comments on commit e1eee34

Please sign in to comment.