Skip to content

Commit

Permalink
fix screen based line types for imerial units
Browse files Browse the repository at this point in the history
  • Loading branch information
qcad committed Oct 15, 2014
1 parent ec5abc9 commit 4beaf4c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/core/RLinetypePattern.cpp
Expand Up @@ -156,7 +156,11 @@ QVector<qreal> RLinetypePattern::getScreenBasedLinetype(bool metric) {

if (pattern.length()>1) {
for (int i = 0; i < pattern.length(); ++i) {
ret << ceil(fabs(pattern[i])) * (metric ? 1.0 : 25.4);
double dash = fabs(pattern[i]);
if (!metric) {
dash*=25.4;
}
ret << ceil(dash);
}
}

Expand Down
1 change: 0 additions & 1 deletion src/core/RMainWindow.cpp
Expand Up @@ -356,7 +356,6 @@ void RMainWindow::removeNewDocumentListener(RNewDocumentListener* l) {
void RMainWindow::notifyNewDocumentListeners(RDocument* document, RTransaction* transaction) {
QList<RNewDocumentListener*>::iterator it;
for (it = newDocumentListeners.begin(); it != newDocumentListeners.end(); ++it) {
qDebug() << "updateNewDocumentListener";
(*it)->updateNewDocumentListener(document, transaction);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/RGraphicsSceneQt.cpp
Expand Up @@ -106,7 +106,7 @@ bool RGraphicsSceneQt::beginPath() {
currentPainterPath.setZLevel(0);

if (screenBasedLinetypes && currentPen.style()==Qt::SolidLine) {
QVector<qreal> pat = currentLinetypePattern.getScreenBasedLinetype(RUnit::isMetric(document->getUnit()));
QVector<qreal> pat = currentLinetypePattern.getScreenBasedLinetype(document->isMetric());
if (!pat.isEmpty()) {
currentPen.setDashPattern(pat);
}
Expand Down

0 comments on commit 4beaf4c

Please sign in to comment.