From 627cc844b8e91360432fd8cd650fe9e98aed1fbc Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 30 Mar 2009 00:17:15 -0400 Subject: Make the grid less obtrusive and make the border stand out --- sigmodr/widgets/mapeditor/MapGrid.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sigmodr/widgets/mapeditor/MapGrid.cpp') diff --git a/sigmodr/widgets/mapeditor/MapGrid.cpp b/sigmodr/widgets/mapeditor/MapGrid.cpp index 1b7794be..653fdd89 100644 --- a/sigmodr/widgets/mapeditor/MapGrid.cpp +++ b/sigmodr/widgets/mapeditor/MapGrid.cpp @@ -43,10 +43,11 @@ void MapGrid::paint(QPainter* painter, const QStyleOptionGraphicsItem* options, { Q_UNUSED(options) Q_UNUSED(widget) - painter->drawRect(QRect(0, 0, m_width, m_height)); + painter->save(); if (m_gridSize) { - painter->setOpacity(.5); + painter->save(); + painter->setOpacity(.25); for (int i = 0; i < m_width; i += m_gridSize) painter->drawLine(i, -5, i, m_height + 5); painter->drawLine(m_width, -5, m_width, m_height + 5); @@ -54,7 +55,11 @@ void MapGrid::paint(QPainter* painter, const QStyleOptionGraphicsItem* options, painter->drawLine(-5, i, m_width + 5, i); painter->drawLine(-5, m_height, m_width + 5, m_height); painter->setOpacity(1); + painter->restore(); } + painter->setPen(QPen(Qt::red, 3)); + painter->drawRect(QRect(0, 0, m_width, m_height)); + painter->restore(); } void MapGrid::setSize(const int width, const int height) -- cgit