Skip to content

Commit

Permalink
Picture: save opacity
Browse files Browse the repository at this point in the history
  • Loading branch information
carrotIndustries committed Apr 11, 2021
1 parent 1febfd3 commit 7924664
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/common/picture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Picture::Picture(const UUID &uu) : uuid(uu)
}

Picture::Picture(const UUID &uu, const json &j)
: uuid(uu), placement(j.at("placement")), on_top(j.value("on_top", false)), px_size(j.at("px_size")),
data_uuid(j.at("data").get<std::string>())
: uuid(uu), placement(j.at("placement")), on_top(j.value("on_top", false)), opacity(j.value("opacity", 1.0)),
px_size(j.at("px_size")), data_uuid(j.at("data").get<std::string>())
{
}

Expand All @@ -20,6 +20,7 @@ json Picture::serialize() const
j["uuid"] = (std::string)uuid;
j["placement"] = placement.serialize();
j["on_top"] = on_top;
j["opacity"] = opacity;
j["px_size"] = px_size;
j["data"] = (std::string)data_uuid;
return j;
Expand Down

0 comments on commit 7924664

Please sign in to comment.