Showing with 12 additions and 4 deletions.
  1. +1 −1 cmake/travis.sh
  2. +11 −3 src/widgets/curveappearance.cpp
2 changes: 1 addition & 1 deletion cmake/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ if [ "$iam" = "$travis" ]; then
if [ ! -d $dep/$cmakever ]; then
cmakebin=x
if [ ! -d $dep/$cmakever ]; then
wget http://www.cmake.org/files/v3.3/$cmakever.tar.gz
wget --no-check-certificate http://www.cmake.org/files/v3.3/$cmakever.tar.gz
checkExitCode
cd $dep
tar xf $builddir/$cmakever.tar.gz
Expand Down
14 changes: 11 additions & 3 deletions src/widgets/curveappearance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ void CurveAppearance::populateSymbolCombos() {


void CurveAppearance::populateSymbolCombo(QComboBox *combo, QColor symbolColor) {
int pixel_ratio = combo->devicePixelRatio();

if (symbolColor == Qt::transparent) {
symbolColor = Qt::black;
}
Expand All @@ -93,7 +95,13 @@ void CurveAppearance::populateSymbolCombo(QComboBox *combo, QColor symbolColor)
combo->setIconSize(QSize(4*h, h));

// fill the point type dialog with point types
QPixmap ppix( 4*h, h );
QPixmap ppix( 4*h*pixel_ratio, h*pixel_ratio );
ppix.setDevicePixelRatio(pixel_ratio);

int pix_w = ppix.width()/pixel_ratio;
int pix_h = ppix.height()/pixel_ratio;


QPainter pp( &ppix );

int currentItem = combo->currentIndex();
Expand All @@ -104,7 +112,7 @@ void CurveAppearance::populateSymbolCombo(QComboBox *combo, QColor symbolColor)

for (int ptype = 0; ptype < KSTPOINT_MAXTYPE; ptype++) {
pp.fillRect(pp.window(), QColor("white"));
CurvePointSymbol::draw(ptype, &pp, ppix.width()/2, ppix.height()/2, h/4);
CurvePointSymbol::draw(ptype, &pp, pix_w/2, pix_h/2, h/4);
combo->addItem(QIcon(ppix), QString());
}

Expand Down Expand Up @@ -451,7 +459,7 @@ void CurveAppearance::drawSampleLine() {
QPixmap pix(_label->contentsRect().width()*pixel_ratio,
_label->contentsRect().height()*pixel_ratio);

pix.setDevicePixelRatio(_label->devicePixelRatio());
pix.setDevicePixelRatio(pixel_ratio);

int pix_w = pix.width()/pixel_ratio;
int pix_h = pix.height()/pixel_ratio;
Expand Down