[Kst] kdeextragear-2/kst/kst
Andrew Walker
arwalker at sumusltd.com
Tue Aug 17 18:27:18 CEST 2004
CVS commit by arwalker:
Base the datamode marker color on the curve color and plot foreground color, rather than using a hard-coded red color.
CCMAIL: 81764-done at bugs.kde.org
M +9 -4 kst2dplot.cpp 1.225
M +1 -1 kst2dplot.h 1.91
--- kdeextragear-2/kst/kst/kst2dplot.cpp #1.224:1.225
@@ -1283,5 +1283,5 @@ void Kst2DPlot::setBorders(double& xleft
-void Kst2DPlot::drawDotAt(QPainter& p, double x, double y) {
+void Kst2DPlot::drawDotAt(QPainter& p, double x, double y, KstBaseCurvePtr curve) {
if (_xLog) {
x = logX(x);
@@ -1294,7 +1294,12 @@ void Kst2DPlot::drawDotAt(QPainter& p, d
int Y1 = (int)(_m_Y * y + _b_Y) + position().y();
if (PlotRegion.contains(X1, Y1)) {
- p.setPen(QPen(QColor(255,0,0), 2));
+ QColor colorInner(curve->getColor().red() > 127 ? 0 : 255,
+ curve->getColor().green() > 127 ? 0 : 255,
+ curve->getColor().blue() > 127 ? 0 : 255);
+ QColor colorOuter(foregroundColor());
+
+ p.setPen(QPen(colorInner, 2));
p.drawArc((int)X1 - 2, (int)Y1 - 2, 4, 4, 0, 5760);
- p.setPen(QPen(QColor(0,0,0), 0));
+ p.setPen(QPen(colorOuter, 0));
p.drawArc((int)X1 - 3, (int)Y1 - 3, 6, 6, 0, 5760);
}
@@ -2203,5 +2208,5 @@ void Kst2DPlot::highlightNearestDataPoin
QPainter p(view);
p.setClipRegion(_lastClipRegion);
- drawDotAt(p, newxpos, newypos);
+ drawDotAt(p, newxpos, newypos, curve);
}
msg = i18n("%3 (%1, %2)").arg(newxpos).arg(newypos,0,'G').arg(curve->tagName());
--- kdeextragear-2/kst/kst/kst2dplot.h #1.90:1.91
@@ -85,5 +85,5 @@ public:
virtual bool layoutPopupMenu(KPopupMenu *menu, const QPoint& pos, KstViewObjectPtr topLevelParent);
- void drawDotAt(QPainter& p, double x, double y);
+ void drawDotAt(QPainter& p, double x, double y, KstBaseCurvePtr curve);
double xInternalAlignment();
void addCurve(KstBaseCurvePtr curve);
More information about the Kst
mailing list