Compare commits

..

No commits in common. "f351939d612dba905f747992f34e579f9b9bd7e1" and "0f9f9d62832c273e876c1d7c7dfc2c4e084a2d73" have entirely different histories.

View File

@ -117,8 +117,6 @@ 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;
@ -193,7 +191,7 @@ struct ApplicationConfig {
AnimationPlayerWidget animation_player_widget;
struct ViewportWidget {
bool visible = true;
bool visible = false;
int position[2] = {20, 20};
int size[2] = {800, 500};
};
@ -205,6 +203,7 @@ 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];
@ -248,6 +247,8 @@ 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) {