Skip to content

Commit 94da42f

Browse files
committed
modified polar plot line pin to adjust to screen resolution so it not so thick on low resolution screens.
1 parent 4ba6488 commit 94da42f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

astigpolargraph.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ astigPolargraph::astigPolargraph( QList<astigSample>list, QWidget *parent) :
1111

1212
chart = new QPolarChart();
1313

14-
1514
// process each wave front and place astig on the chart
1615
ui->waveFrontTable->setRowCount(list.size());
1716
ui->waveFrontTable->setSelectionBehavior(QAbstractItemView::SelectRows);
@@ -32,7 +31,11 @@ astigPolargraph::astigPolargraph( QList<astigSample>list, QWidget *parent) :
3231
double maxAstig = 1.;
3332

3433
QVector<wavefront *> wavefronts =SurfaceManager::get_instance()->m_wavefronts;
35-
34+
QScreen *screen = QGuiApplication::primaryScreen();
35+
qreal screenDPI = screen->physicalDotsPerInchX();
36+
int pensize = 5 * screenDPI/256.; // adjust pen size to screen resolution. 256 is DPI of my 4K 17 inch laptop
37+
if (pensize < 1)
38+
pensize = 1;
3639
for(int ndx = 0; ndx < list.length(); ++ndx){
3740

3841
QString name = list[ndx].m_name;
@@ -74,7 +77,7 @@ astigPolargraph::astigPolargraph( QList<astigSample>list, QWidget *parent) :
7477
connect(line, &QLineSeries::hovered, this, &astigPolargraph::tooltip);
7578
chart->legend()->markers(line)[0]->setVisible(false);
7679

77-
line->setPen(QPen(series->brush(),5));
80+
line->setPen(QPen(series->brush(),pensize));
7881

7982
QTableWidgetItem *pv = new QTableWidgetItem(QString().number(mag), 0);
8083
item->setForeground(series->brush());

0 commit comments

Comments
 (0)