mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-12-25 10:01:38 +08:00
bugfix: symbol in key is drawn with anti-aliasing
This commit is contained in:
parent
c935df7923
commit
48c376fe1b
@ -1160,14 +1160,8 @@ void JKQtBasePlotter::paintPlot(JKQTPEnhancedPainter& painter, bool drawOverlays
|
|||||||
painter.fillRect(QRectF(iplotBorderLeft, iplotBorderTop, plotWidth, plotHeight), QBrush(plotBackgroundColor));
|
painter.fillRect(QRectF(iplotBorderLeft, iplotBorderTop, plotWidth, plotHeight), QBrush(plotBackgroundColor));
|
||||||
painter.restore();
|
painter.restore();
|
||||||
painter.setRenderHint(JKQTPEnhancedPainter::NonCosmeticDefaultPen, true);
|
painter.setRenderHint(JKQTPEnhancedPainter::NonCosmeticDefaultPen, true);
|
||||||
if (useAntiAliasingForSystem)
|
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, useAntiAliasingForSystem);
|
||||||
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, true);
|
painter.setRenderHint(JKQTPEnhancedPainter::TextAntialiasing, useAntiAliasingForText);
|
||||||
else
|
|
||||||
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, false);
|
|
||||||
if (useAntiAliasingForText)
|
|
||||||
painter.setRenderHint(JKQTPEnhancedPainter::TextAntialiasing, true);
|
|
||||||
else
|
|
||||||
painter.setRenderHint(JKQTPEnhancedPainter::TextAntialiasing, false);
|
|
||||||
plotSystemGrid(painter);
|
plotSystemGrid(painter);
|
||||||
|
|
||||||
if (!plotLabel.isEmpty()) {
|
if (!plotLabel.isEmpty()) {
|
||||||
@ -1181,34 +1175,28 @@ void JKQtBasePlotter::paintPlot(JKQTPEnhancedPainter& painter, bool drawOverlays
|
|||||||
mathText.draw(painter, iplotBorderLeft+(plotWidth-s.width())/2.0,plotBorderTop+a*1.2);
|
mathText.draw(painter, iplotBorderLeft+(plotWidth-s.width())/2.0,plotBorderTop+a*1.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useAntiAliasingForGraphs)
|
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, useAntiAliasingForGraphs);
|
||||||
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, true);
|
painter.setRenderHint(JKQTPEnhancedPainter::TextAntialiasing, useAntiAliasingForText);
|
||||||
else
|
|
||||||
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, false);
|
|
||||||
painter.save();
|
painter.save();
|
||||||
plotGraphs(painter);
|
plotGraphs(painter);
|
||||||
painter.restore();
|
painter.restore();
|
||||||
if (useAntiAliasingForSystem)
|
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, useAntiAliasingForSystem);
|
||||||
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, true);
|
painter.setRenderHint(JKQTPEnhancedPainter::TextAntialiasing, useAntiAliasingForText);
|
||||||
else
|
|
||||||
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, false);
|
|
||||||
if (useAntiAliasingForText)
|
|
||||||
painter.setRenderHint(JKQTPEnhancedPainter::TextAntialiasing, true);
|
|
||||||
else
|
|
||||||
painter.setRenderHint(JKQTPEnhancedPainter::TextAntialiasing, false);
|
|
||||||
plotSystemXAxis(painter);
|
plotSystemXAxis(painter);
|
||||||
plotSystemYAxis(painter);
|
plotSystemYAxis(painter);
|
||||||
|
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, useAntiAliasingForGraphs);
|
||||||
|
painter.setRenderHint(JKQTPEnhancedPainter::TextAntialiasing, useAntiAliasingForText);
|
||||||
if (showKey) plotKey(painter);
|
if (showKey) plotKey(painter);
|
||||||
|
painter.setRenderHint(JKQTPEnhancedPainter::TextAntialiasing, useAntiAliasingForText);
|
||||||
if (drawOverlays) plotOverlays(painter);
|
if (drawOverlays) plotOverlays(painter);
|
||||||
//qDebug()<<" end JKQtPlotterBase::paintPlot";
|
//qDebug()<<" end JKQtPlotterBase::paintPlot";
|
||||||
}
|
}
|
||||||
|
|
||||||
void JKQtBasePlotter::paintOverlays(JKQTPEnhancedPainter &painter) {
|
void JKQtBasePlotter::paintOverlays(JKQTPEnhancedPainter &painter) {
|
||||||
painter.setRenderHint(JKQTPEnhancedPainter::NonCosmeticDefaultPen, true);
|
painter.setRenderHint(JKQTPEnhancedPainter::NonCosmeticDefaultPen, true);
|
||||||
if (useAntiAliasingForGraphs)
|
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, useAntiAliasingForGraphs);
|
||||||
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, true);
|
painter.setRenderHint(JKQTPEnhancedPainter::TextAntialiasing, useAntiAliasingForText);
|
||||||
else
|
|
||||||
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, false);
|
|
||||||
painter.save();
|
painter.save();
|
||||||
plotOverlays(painter);
|
plotOverlays(painter);
|
||||||
painter.restore();
|
painter.restore();
|
||||||
@ -4249,7 +4237,7 @@ bool JKQtBasePlotter::containsGraph(JKQTPgraph* gr) const {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void JKQtBasePlotter::setGraphsDataRange(long long datarange_start, long long datarange_end) {
|
void JKQtBasePlotter::setGraphsDataRange(int datarange_start, int datarange_end) {
|
||||||
for (int i=0; i<graphs.size(); i++) {
|
for (int i=0; i<graphs.size(); i++) {
|
||||||
graphs[i]->set_datarange_start(datarange_start);
|
graphs[i]->set_datarange_start(datarange_start);
|
||||||
graphs[i]->set_datarange_end(datarange_end);
|
graphs[i]->set_datarange_end(datarange_end);
|
||||||
|
@ -723,7 +723,7 @@ class LIB_EXPORT JKQtBasePlotter: public QObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** \brief set the datarange of all current graphs to the given values */
|
/** \brief set the datarange of all current graphs to the given values */
|
||||||
void setGraphsDataRange(long long datarange_start, long long datarange_end);
|
void setGraphsDataRange(int datarange_start, int datarange_end);
|
||||||
|
|
||||||
void set_maintainAspectRatio(bool value) {
|
void set_maintainAspectRatio(bool value) {
|
||||||
maintainAspectRatio=value;
|
maintainAspectRatio=value;
|
||||||
|
Loading…
Reference in New Issue
Block a user