| 827 | } |
| 828 | |
| 829 | void Map::drawTemplates(QPainter* painter, const QRectF& bounding_box, int first_template, int last_template, const MapView* view, bool on_screen) const |
| 830 | { |
| 831 | for (int i = first_template; i <= last_template; ++i) |
| 832 | { |
| 833 | const Template* temp = getTemplate(i); |
| 834 | if (temp->getTemplateState() != Template::Loaded) |
| 835 | continue; |
| 836 | |
| 837 | double scale = std::max(temp->getTemplateScaleX(), temp->getTemplateScaleY()); |
| 838 | auto visibility = TemplateVisibility{ 1, true }; |
| 839 | if (view) |
| 840 | { |
| 841 | visibility = view->getTemplateVisibility(temp); |
| 842 | visibility.visible &= visibility.opacity > 0; |
| 843 | scale *= view->getZoom(); |
| 844 | } |
| 845 | if (visibility.visible) |
| 846 | { |
| 847 | Q_ASSERT(visibility.opacity == 1 || painter->paintEngine()->hasFeature(QPaintEngine::ConstantOpacity)); |
| 848 | painter->save(); |
| 849 | temp->drawTemplate(painter, bounding_box, scale, on_screen, visibility.opacity); |
| 850 | painter->restore(); |
| 851 | } |
| 852 | } |
| 853 | } |
| 854 | |
| 855 | void Map::updateObjects() |
| 856 | { |
no test coverage detected