summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-03-30 00:17:15 -0400
committerBen Boeckel <MathStuf@gmail.com>2009-03-30 00:17:15 -0400
commit627cc844b8e91360432fd8cd650fe9e98aed1fbc (patch)
treece1608e46126c971d7aaf35da8c9345400913ea5
parent0a0c52e05ae8c1b967ce6193d13dc2dda566c92c (diff)
downloadsigen-627cc844b8e91360432fd8cd650fe9e98aed1fbc.tar.gz
sigen-627cc844b8e91360432fd8cd650fe9e98aed1fbc.tar.xz
sigen-627cc844b8e91360432fd8cd650fe9e98aed1fbc.zip
Make the grid less obtrusive and make the border stand out
-rw-r--r--sigmodr/widgets/mapeditor/MapGrid.cpp9
1 files changed, 7 insertions, 2 deletions
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)