Source
249
249
250
250
//////////////////////////
251
251
// QPSYMBOL DEFINITIONS //
252
252
//////////////////////////
253
253
254
254
QPSymbol::QPSymbol() : m_style(QPOptions::symbol(style())), m_char('o'),
255
255
m_heightIsPixel(true), m_drawPen(&pen()), m_drawBrush(&brush()) { }
256
256
257
257
#if QWT_VERSION >= 0x060000
258
258
QPSymbol::QPSymbol(QwtSymbol::Style style, const QBrush & brush,
259
-
const QPen & pen, const QSize & sz) : QwtSymbol(style, brush, pen, sz) { }
260
-
#else
259
+
const QPen & pen, const QSize & sz) : QwtSymbol(style, brush, pen, sz) { }
260
+
#else
261
261
QPSymbol::QPSymbol(const QwtSymbol& s): QwtSymbol(s),
262
262
m_style(QPOptions::symbol(s.style())), m_char('o'),
263
263
m_heightIsPixel(true), m_drawPen(&pen()), m_drawBrush(&brush()) { }
264
264
#endif
265
265
266
266
QPSymbol::QPSymbol(const PlotSymbol& copy) : m_style(QPOptions::symbol(style())),
267
267
m_heightIsPixel(true), m_drawPen(&pen()), m_drawBrush(&brush()) {
268
268
operator=(copy); }
269
269
270
270
QPSymbol::QPSymbol(const PlotSymbolPtr copy) : m_style(CIRCLE), m_char('o'),
278
278
if(m_style == PIXEL) return psize_t(1, 1);
279
279
const QSize& s = QwtSymbol::size();
280
280
return psize_t(s.width(), s.height());
281
281
}
282
282
283
283
void QPSymbol::setSize(double width, double height, bool heightIsPixel) {
284
284
const QSize& s = QwtSymbol::size();
285
285
if(s.width() != width || s.height() != height || (isCharacter() &&
286
286
heightIsPixel != m_heightIsPixel)) {
287
287
m_heightIsPixel = heightIsPixel;
288
+
#if QWT_VERSION >= 0x060000
289
+
// CAS-12378, make plots look like on RHEL6/Qwt5
290
+
width += 1.0;
291
+
height += 1.0;
292
+
#endif
288
293
QwtSymbol::setSize((int)(width + 0.5), (int)(height + 0.5));
289
-
} else m_heightIsPixel = heightIsPixel;
294
+
} else {
295
+
m_heightIsPixel = heightIsPixel;
296
+
}
290
297
}
291
298
292
299
bool QPSymbol::heightIsPixel() const { return m_heightIsPixel; }
293
300
294
301
void QPSymbol::setHeightIsPixel(bool pixel) {
295
302
if(isCharacter() && pixel != m_heightIsPixel) {
296
303
m_heightIsPixel = pixel;
297
304
QwtSymbol::setSize(QwtSymbol::size());
298
305
} else m_heightIsPixel = pixel;
299
306
}
395
402
switch(a) {
396
403
case X_BOTTOM: return QwtPlot::xBottom;
397
404
case X_TOP: return QwtPlot::xTop;
398
405
case Y_LEFT: return QwtPlot::yLeft;
399
406
case Y_RIGHT: return QwtPlot::yRight;
400
407
default: return QwtPlot::xBottom;
401
408
}
402
409
}
403
410
404
411
bool QPOptions::isAxisX( PlotAxis a ){
405
-
bool horizontal = false;
406
-
if ( a == X_BOTTOM || a == X_TOP ){
407
-
horizontal = true;
408
-
}
409
-
return horizontal;
412
+
bool horizontal = false;
413
+
if ( a == X_BOTTOM || a == X_TOP ){
414
+
horizontal = true;
415
+
}
416
+
return horizontal;
410
417
}
411
418
412
419
413
420
PlotAxis QPOptions::axis(QwtPlot::Axis a) {
414
421
switch(a) {
415
422
case QwtPlot::xBottom: return X_BOTTOM;
416
423
case QwtPlot::xTop: return X_TOP;
417
424
case QwtPlot::yLeft: return Y_LEFT;
418
425
case QwtPlot::yRight: return Y_RIGHT;
419
426
default: return X_BOTTOM;