Add PNG support handling in GraphicsEditor and include <cstring> in file_dialog

- Introduced conditional compilation for PNG clipboard operations in graphics_editor.cc, providing user feedback when PNG support is disabled.
- Added <cstring> header in file_dialog.cc to support string manipulation functions, enhancing functionality.
This commit is contained in:
scawful
2025-09-25 10:57:47 -04:00
parent 4f5250f5ca
commit d0ff581412
2 changed files with 6 additions and 0 deletions

View File

@@ -134,6 +134,7 @@ void GraphicsEditor::DrawGfxEditToolset() {
TableNextColumn();
if (Button(ICON_MD_CONTENT_PASTE)) {
#if YAZE_LIB_PNG == 1
std::vector<uint8_t> png_data;
int width, height;
core::GetImageFromClipboard(png_data, width, height);
@@ -145,6 +146,10 @@ void GraphicsEditor::DrawGfxEditToolset() {
Renderer::Get().UpdateBitmap(
&gfx::Arena::Get().mutable_gfx_sheets()->at(current_sheet_));
}
#else
// PNG support disabled - show message or alternative action
status_ = absl::UnimplementedError("PNG import not available in this build");
#endif
}
HOVER_HINT("Paste from Clipboard");