void EditorLayersGui::update_tip() { if ( hovered_layer >= layers.size() ) { object_tip = NULL; return; } std::unique_ptr<Tip> new_tip(new Tip(layers[hovered_layer]->layer)); object_tip = move(new_tip); }
void EditorInputCenter::hover_object() { for (auto& moving_object : Editor::current()->currentsector->moving_objects) { auto pm = dynamic_cast<PointMarker*>(moving_object); if (!moving_object->do_save() && !pm) { continue; } Rectf bbox = moving_object->get_bbox(); if (sector_pos.x >= bbox.p1.x && sector_pos.y >= bbox.p1.y && sector_pos.x <= bbox.p2.x && sector_pos.y <= bbox.p2.y ) { if (moving_object != hovered_object) { if (moving_object->do_save()) { std::unique_ptr<Tip> new_tip(new Tip(moving_object)); object_tip = move(new_tip); } hovered_object = moving_object; } return; } } object_tip = NULL; hovered_object = NULL; }