diff --git a/scwx-qt/source/scwx/qt/main/main_window.cpp b/scwx-qt/source/scwx/qt/main/main_window.cpp index a209de28..d85a5a84 100644 --- a/scwx-qt/source/scwx/qt/main/main_window.cpp +++ b/scwx-qt/source/scwx/qt/main/main_window.cpp @@ -788,6 +788,7 @@ void MainWindowImpl::ConfigureMapLayout() { if (maps_.at(mapIndex) == nullptr) { + // NOLINTNEXTLINE(cppcoreguidelines-owning-memory): Owned by parent maps_[mapIndex] = new map::MapWidget(mapIndex, settings_, glContext); } diff --git a/scwx-qt/source/scwx/qt/map/color_table_layer.cpp b/scwx-qt/source/scwx/qt/map/color_table_layer.cpp index f9046120..30b8a11e 100644 --- a/scwx-qt/source/scwx/qt/map/color_table_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/color_table_layer.cpp @@ -176,7 +176,13 @@ void ColorTableLayer::Render( gl.glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices); gl.glDrawArrays(GL_TRIANGLES, 0, 6); - mapContext->set_color_table_margins(QMargins {0, 0, 0, 10}); + static constexpr int kLeftMargin_ = 0; + static constexpr int kTopMargin_ = 0; + static constexpr int kRightMargin_ = 0; + static constexpr int kBottomMargin_ = 10; + + mapContext->set_color_table_margins( + QMargins {kLeftMargin_, kTopMargin_, kRightMargin_, kBottomMargin_}); } else { diff --git a/scwx-qt/source/scwx/qt/map/draw_layer.cpp b/scwx-qt/source/scwx/qt/map/draw_layer.cpp index fbe9a087..4128f893 100644 --- a/scwx-qt/source/scwx/qt/map/draw_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/draw_layer.cpp @@ -131,8 +131,9 @@ void DrawLayer::RenderWithoutImGui( p->textureAtlas_ = glContext->GetTextureAtlas(); // Determine if the texture atlas changed since last render - std::uint64_t newTextureAtlasBuildCount = glContext->texture_buffer_count(); - bool textureAtlasChanged = + const std::uint64_t newTextureAtlasBuildCount = + glContext->texture_buffer_count(); + const bool textureAtlasChanged = newTextureAtlasBuildCount != p->textureAtlasBuildCount_; // Set OpenGL blend mode for transparency diff --git a/scwx-qt/source/scwx/qt/map/map_widget.cpp b/scwx-qt/source/scwx/qt/map/map_widget.cpp index cfeba407..78362a28 100644 --- a/scwx-qt/source/scwx/qt/map/map_widget.cpp +++ b/scwx-qt/source/scwx/qt/map/map_widget.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -70,13 +71,13 @@ class MapWidgetImpl : public QObject public: explicit MapWidgetImpl(MapWidget* widget, std::size_t id, - const QMapLibre::Settings& settings, + QMapLibre::Settings settings, std::shared_ptr glContext) : id_ {id}, uuid_ {boost::uuids::random_generator()()}, glContext_ {std::move(glContext)}, widget_ {widget}, - settings_(settings), + settings_(std::move(settings)), map_(), layerList_ {}, imGuiRendererInitialized_ {false}, diff --git a/scwx-qt/source/scwx/qt/map/overlay_layer.cpp b/scwx-qt/source/scwx/qt/map/overlay_layer.cpp index b7853738..2af24d43 100644 --- a/scwx-qt/source/scwx/qt/map/overlay_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/overlay_layer.cpp @@ -513,7 +513,7 @@ void OverlayLayer::Render(const std::shared_ptr& mapContext, p->icons_->SetIconVisible(p->mapCenterIcon_, generalSettings.show_map_center().GetValue()); - QMargins colorTableMargins = mapContext->color_table_margins(); + const QMargins colorTableMargins = mapContext->color_table_margins(); if (colorTableMargins != p->lastColorTableMargins_ || p->firstRender_) { // Draw map logo with a 10x10 indent from the bottom left