MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / drawTemplates

Method drawTemplates

src/core/map.cpp:829–853  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

827}
828
829void 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
855void Map::updateObjects()
856{

Callers 2

drawPageMethod · 0.80
updateTemplateCacheMethod · 0.80

Calls 7

getTemplateStateMethod · 0.80
getTemplateScaleXMethod · 0.80
getTemplateScaleYMethod · 0.80
getTemplateVisibilityMethod · 0.80
getZoomMethod · 0.80
saveMethod · 0.45
drawTemplateMethod · 0.45

Tested by

no test coverage detected