Compare commits
2 Commits
0f9f9d6283
...
f351939d61
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f351939d61 | ||
![]() |
a977698336 |
@ -117,6 +117,8 @@ struct Viewport {
|
||||
sg_image depth_image = {};
|
||||
int size[2] = {400, 400};
|
||||
|
||||
Viewport() { Resize(size[0], size[1]); }
|
||||
|
||||
void Resize(int width, int height) {
|
||||
width = width < 1 ? 1 : width;
|
||||
height = height < 1 ? 1 : height;
|
||||
@ -191,7 +193,7 @@ struct ApplicationConfig {
|
||||
AnimationPlayerWidget animation_player_widget;
|
||||
|
||||
struct ViewportWidget {
|
||||
bool visible = false;
|
||||
bool visible = true;
|
||||
int position[2] = {20, 20};
|
||||
int size[2] = {800, 500};
|
||||
};
|
||||
@ -203,7 +205,6 @@ struct ApplicationConfig {
|
||||
};
|
||||
|
||||
void to_json(nlohmann::json& j, const ApplicationConfig& config) {
|
||||
std::cerr << "converting to json" << std::endl;
|
||||
j["type"] = "AnimTestbedConfig";
|
||||
|
||||
j["main_window"]["position"][0] = config.window_position[0];
|
||||
@ -247,8 +248,6 @@ void to_json(nlohmann::json& j, const ApplicationConfig& config) {
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, ApplicationConfig& config) {
|
||||
std::cerr << "converting from json" << std::endl;
|
||||
|
||||
if (j.contains("main_window")) {
|
||||
if (j["main_window"].contains("position")
|
||||
and j["main_window"]["position"].size() == 2) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user