Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
842 B
Raw Blame
/*
 *  SPDX-FileCopyrightText: 2016 Dmitry Kazakov <[email protected]>
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef KOFLAKECOORDINATE_SYSTEM_H
#define KOFLAKECOORDINATE_SYSTEM_H

#include <QString>

namespace KoFlake {

enum CoordinateSystem {
    UserSpaceOnUse,
    ObjectBoundingBox
};

inline CoordinateSystem coordinatesFromString(const QString &value, CoordinateSystem defaultValue)
{
    CoordinateSystem result = defaultValue;

    if (value == "userSpaceOnUse") {
        result = UserSpaceOnUse;
    } else if (value == "objectBoundingBox") {
        result = ObjectBoundingBox;
    }

    return result;
}

inline QString coordinateToString(CoordinateSystem value)
{
    return
        value == ObjectBoundingBox?
        "objectBoundingBox" :
        "userSpaceOnUse";
}
}

#endif // KOFLAKECOORDINATE_SYSTEM_H