Refractor and clean code

This commit is contained in:
Johann Granström
2020-09-24 11:41:00 +02:00
parent 6cd82e8e8a
commit 2401ee5b26
3 changed files with 36 additions and 34 deletions

View File

@@ -184,12 +184,14 @@ namespace openspace {
std::string messageType = "UPOP";
std::string subject = lengthOfIdentifier + identifier + lengthOfValue + propertyValue;
LERROR(fmt::format("OPACITY MESSAGE: {}", propertyValue));
// Format length of subject to always be 4 digits
std::ostringstream os;
os << std::setfill('0') << std::setw(4) << subject.length();
std::string lengthOfSubject = os.str();
std::string message = messageType + lengthOfSubject + subject;
LERROR(fmt::format("OPACITY MESSAGE: {}", message));
peer->connection.sendMessage(message);
};
opacityProperty->onChange(updateOpacity);