Image owns its alt text.

This commit is contained in:
2025-08-21 17:36:42 -04:00
parent b934b115ed
commit 4274490a86
2 changed files with 14 additions and 13 deletions

View File

@ -3,6 +3,9 @@
#include "core.hh"
#include <optional>
#include <string>
namespace dw {
/**
@ -115,7 +118,7 @@ public:
class Image: public core::Widget, public core::ImgRenderer
{
private:
char *altText;
std::optional< std::string > altText;
core::Imgbuf *buffer;
int bufWidth, bufHeight;
int altTextWidth;
@ -145,7 +148,7 @@ protected:
//core::Iterator *iterator (Content::Type mask, bool atEnd);
public:
Image(const char *altText);
Image(std::optional< std::string_view > altText);
~Image();
// For images, the minimal width is not well defined, and