@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2023 Robin Lindén <dev@robinlinden.eu>
// SPDX-FileCopyrightText: 2023-2024 Robin Lindén <dev@robinlinden.eu>
//
// SPDX-License-Identifier: BSD-2-Clause
@@ -35,12 +35,12 @@ class SfmlType : public IType {
public:
std::optional<std::shared_ptr<IFont const>> font(std::string_view name) const override;
void set_font(std::string name, std::shared_ptr<SfmlFont const> font) {
void set_font(std::string name, std::optional<std::shared_ptr<SfmlFont const>> font) {
font_cache_.insert_or_assign(std::move(name), std::move(font));
}
private:
mutable std::map<std::string, std::shared_ptr<SfmlFont const>, std::less<>> font_cache_;
mutable std::map<std::string, std::optional<std::shared_ptr<SfmlFont const>>, std::less<>> font_cache_;
};
} // namespace type