Start document model tests
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "assets/image_format.h"
|
||||
#include "document/document.h"
|
||||
#include "foundation/parse.h"
|
||||
#include "foundation/result.h"
|
||||
|
||||
@@ -83,10 +84,22 @@ int create_document(int argc, char** argv)
|
||||
return 2;
|
||||
}
|
||||
|
||||
const auto document = pp::document::CanvasDocument::create(
|
||||
pp::document::DocumentConfig {
|
||||
.width = args.width,
|
||||
.height = args.height,
|
||||
.layer_count = args.layers,
|
||||
});
|
||||
if (!document) {
|
||||
print_error("create-document", document.status().message);
|
||||
return 2;
|
||||
}
|
||||
|
||||
std::cout << "{\"ok\":true,\"command\":\"create-document\",\"document\":{"
|
||||
<< "\"width\":" << args.width
|
||||
<< ",\"height\":" << args.height
|
||||
<< ",\"layers\":" << args.layers
|
||||
<< "\"width\":" << document.value().width()
|
||||
<< ",\"height\":" << document.value().height()
|
||||
<< ",\"layers\":" << document.value().layers().size()
|
||||
<< ",\"activeLayer\":" << document.value().active_layer_index()
|
||||
<< "}}\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user