Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-02-19 13:26:32 +0000
committerStijn Buys <ingar@osirion.org>2012-02-19 13:26:32 +0000
commit46f48143ed59eddafa86f2711f518792f362a46c (patch)
tree42db107c1ea0f361bb9cdda18959a3fa6d3b84c9 /src/mapwidget.cc
parent8aa0a55840f02482884e29b33b770daa6028b81e (diff)
Added text area with all entity properties, made location editable.
Diffstat (limited to 'src/mapwidget.cc')
-rw-r--r--src/mapwidget.cc24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/mapwidget.cc b/src/mapwidget.cc
index 779bf91..febf6ac 100644
--- a/src/mapwidget.cc
+++ b/src/mapwidget.cc
@@ -136,7 +136,11 @@ void MapWidget::resizeEvent (QResizeEvent *event)
void MapWidget::paintEvent(QPaintEvent *event)
{
- QPen pen(Qt::blue, 1, Qt::SolidLine);
+ const QColor gridlinecolor(0, 0, 128);
+ const QColor axislinecolor(128, 0, 0);
+
+
+ QPen pen(gridlinecolor, 1, Qt::SolidLine);
QPainter painter(this);
painter.setPen(pen);
@@ -146,7 +150,14 @@ void MapWidget::paintEvent(QPaintEvent *event)
// gridsize is the size of one grid square in screen coordinates
int gridsize = width() / mapwidget_zoom;
- int x = center_x + width() / 2;
+ int x = center_x + width() / 2;
+ pen.setColor(axislinecolor);
+ painter.setPen(pen);
+ painter.drawLine(x, 0, x, height());
+ x -= gridsize;
+ pen.setColor(gridlinecolor);
+ painter.setPen(pen);
+
while (x > 0) {
painter.drawLine(x, 0, x, height());
x -= gridsize;
@@ -157,7 +168,16 @@ void MapWidget::paintEvent(QPaintEvent *event)
x += gridsize;
}
+
int y = center_y + height() / 2;
+ pen.setColor(axislinecolor);
+ painter.setPen(pen);
+
+ painter.drawLine(0, y, width(), y);
+ y -= gridsize;
+ pen.setColor(gridlinecolor);
+ painter.setPen(pen);
+
while (y > 0) {
painter.drawLine(0, y, width(), y);
y -= gridsize;