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:
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ void GraphicsEditor::DrawGfxEditToolset() {
|
|||||||
|
|
||||||
TableNextColumn();
|
TableNextColumn();
|
||||||
if (Button(ICON_MD_CONTENT_PASTE)) {
|
if (Button(ICON_MD_CONTENT_PASTE)) {
|
||||||
|
#if YAZE_LIB_PNG == 1
|
||||||
std::vector<uint8_t> png_data;
|
std::vector<uint8_t> png_data;
|
||||||
int width, height;
|
int width, height;
|
||||||
core::GetImageFromClipboard(png_data, width, height);
|
core::GetImageFromClipboard(png_data, width, height);
|
||||||
@@ -145,6 +146,10 @@ void GraphicsEditor::DrawGfxEditToolset() {
|
|||||||
Renderer::Get().UpdateBitmap(
|
Renderer::Get().UpdateBitmap(
|
||||||
&gfx::Arena::Get().mutable_gfx_sheets()->at(current_sheet_));
|
&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");
|
HOVER_HINT("Paste from Clipboard");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user