Commit 7ff7e60b authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Cleanup: Make projection color a defined tag.

parent 604efc8d
......@@ -294,8 +294,8 @@ KisImageWSP KisKraLoader::loadXML(const KoXmlElement& element)
KoXmlNode child;
for (child = element.lastChild(); !child.isNull(); child = child.previousSibling()) {
KoXmlElement e = child.toElement();
if(e.tagName() == "ProjectionBackgroundColor") {
if (e.hasAttribute("ColorData")) {
if(e.tagName() == CANVASPROJECTIONCOLOR) {
if (e.hasAttribute(COLORBYTEDATA)) {
QByteArray colorData = QByteArray::fromBase64(e.attribute("ColorData").toLatin1());
KoColor color((const quint8*)colorData.data(), image->colorSpace());
image->setDefaultProjectionColor(color);
......
......@@ -294,10 +294,10 @@ QStringList KisKraSaver::errorMessages() const
void KisKraSaver::saveBackgroundColor(QDomDocument& doc, QDomElement& element, KisImageWSP image)
{
QDomElement e = doc.createElement("ProjectionBackgroundColor");
QDomElement e = doc.createElement(CANVASPROJECTIONCOLOR);
KoColor color = image->defaultProjectionColor();
QByteArray colorData = QByteArray::fromRawData((const char*)color.data(), color.colorSpace()->pixelSize());
e.setAttribute("ColorData", QString(colorData.toBase64()));
e.setAttribute(COLORBYTEDATA, QString(colorData.toBase64()));
element.appendChild(e);
}
......
......@@ -116,6 +116,8 @@ const QString PROOFINGDEPTH = "proofing-depth";
const QString PROOFINGINTENT = "proofing-intent";
const QString PROOFINGWARNINGCOLOR ="ProofingWarningColor";
const QString ICCPROOFINGPROFILE ="icc-proofing-profile";
const QString CANVASPROJECTIONCOLOR = "ProjectionBackgroundColor";
const QString COLORBYTEDATA = "ColorData";
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment