added a ruler for measuring

added support for meta-data editing
improved element selection
changed zooming
fixed some issues with layer events
fixed issue with 3D outline
fixed loading issue for old maps
some interface changes
This commit is contained in:
2017-03-10 13:44:17 +01:00
parent 2297a76c53
commit f40fc9a823
32 changed files with 809 additions and 198 deletions

View File

@@ -46,6 +46,15 @@ public:
setFocused(m, nullptr);
}
/**
* @brief change the currently focused element. throws an event.
* @param el the to-be-focused element or null
* @return true if the focused element has changed. false otherwise
*/
bool focus(MapView2D* v, MapModelElement* el) {
setFocused(v, el);
}
private:
void processUnfocus(MapView2D* m, MapModelElement* elem) {
@@ -202,9 +211,11 @@ private:
const float g = m->getScaler().sm(15); // increase each BBox by 15 px (needed mainly for hor/ver lines)
#warning "which elements to select? among all currently visible? or only among the selected layer?"
// get all elements with bounding-box matchings
std::vector<MapModelElement*> possible;
for (MapModelElement* el : m->getModel()->getSelectedLayerElements()) {
// for (MapModelElement* el : m->getModel()->getSelectedLayerElements()) {
for (MapModelElement* el : m->getModel()->getVisibleElements()) {
if (!el->getMV2D()) {continue;}
BBox2 bbox = el->getMV2D()->getBoundingBox(); // elements 2D bbox
bbox.grow(Point2(g, g)); // grow a little (needed for straight lines)