From f4eaee212ddc756669e80cb53a1cbe59176d7716 2013-06-12 04:42:20 From: Miikka Heikkinen Date: 2013-06-12 04:42:20 Subject: [PATCH] Adjust various margins and paddings. The text items have been changed to use QGraphicsTextItem bounding rects instead of calculating dimensions using QFontMetrics. It seems that QGraphicsTextItem boundingRect involves a lot more of a margin than QFontMetrics provided. To compensate, various margins and paddings have been adjusted lower. Change-Id: Idebf939f5dd804fb96daeaea4bbf1b45f4f02908 Reviewed-by: Mika Salmela --- diff --git a/src/axis/chartaxiselement_p.h b/src/axis/chartaxiselement_p.h index f7730c3..62c686a 100644 --- a/src/axis/chartaxiselement_p.h +++ b/src/axis/chartaxiselement_p.h @@ -59,8 +59,8 @@ public: QAbstractAxis *axis() const { return m_axis; } void setLayout(QVector &layout) { m_layout = layout; } QVector &layout() { return m_layout; } // Modifiable reference - inline qreal labelPadding() const { return qreal(5.0); } - inline qreal titlePadding() const { return qreal(3.0); } + inline qreal labelPadding() const { return qreal(1.0); } + inline qreal titlePadding() const { return qreal(1.0); } void setLabels(const QStringList &labels) { m_labelsList = labels; } QStringList labels() const { return m_labelsList; } diff --git a/src/legend/legendmarkeritem.cpp b/src/legend/legendmarkeritem.cpp index 533308d..92f9202 100644 --- a/src/legend/legendmarkeritem.cpp +++ b/src/legend/legendmarkeritem.cpp @@ -38,8 +38,8 @@ LegendMarkerItem::LegendMarkerItem(QLegendMarkerPrivate *marker, QGraphicsObject m_boundingRect(0,0,0,0), m_textItem(new QGraphicsTextItem(this)), m_rectItem(new QGraphicsRectItem(this)), - m_margin(4), - m_space(4), + m_margin(1), + m_space(2), m_hovering(false), m_pressPos(0, 0) {