many changes :P
This commit is contained in:
@@ -5,12 +5,23 @@
|
||||
|
||||
class ToolMapGrid : public Tool {
|
||||
|
||||
private:
|
||||
|
||||
bool show = true;
|
||||
|
||||
public:
|
||||
|
||||
virtual void keyPressEvent(MapView2D* m, QKeyEvent* e) {
|
||||
(void) m;
|
||||
if (e->key() == Qt::Key_NumberSign) { show = !show; }
|
||||
}
|
||||
|
||||
void paintBefore(MapView2D* m, Painter& p) override {
|
||||
|
||||
(void) m;
|
||||
|
||||
if (!show) {return;}
|
||||
|
||||
static const QColor cB(250,250,250);
|
||||
static const QColor cN(235,235,235);
|
||||
static const QColor c0(128,128,128);
|
||||
|
||||
@@ -86,11 +86,9 @@ public:
|
||||
p.p->drawLine(mouseX, 0, mouseX, rs);
|
||||
|
||||
|
||||
|
||||
p.setPenBrush(Qt::black, Qt::NoBrush);
|
||||
char buf[128];
|
||||
|
||||
|
||||
// y-axis
|
||||
p.p->setClipRect(ry);
|
||||
for (float y = r.y0; y <= r.y1; y += step) {
|
||||
@@ -131,6 +129,7 @@ public:
|
||||
p.p->drawText(xMajor+2, 18, buf);
|
||||
}
|
||||
|
||||
|
||||
p.p->setClipping(false);
|
||||
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
// get all elements with bounding-box matchings
|
||||
std::vector<MapModelElement*> possible;
|
||||
for (MapModelElement* el : m->getModel()->getSelectedLayerElements()) {
|
||||
if (!el->getMV2D()) {continue;}
|
||||
BBox2 bbox = el->getMV2D()->getBoundingBox(); // elements 3D bbox
|
||||
bbox.grow(Point2(g, g)); // grow a little (needed for straight lines)
|
||||
if (bbox.contains(p2)) {possible.push_back(el);} // intersection?
|
||||
|
||||
Reference in New Issue
Block a user