Files
Leeksov 4647310322 GLEGram 12.5 — Initial public release
Based on Swiftgram 12.5 (Telegram iOS 12.5).
All GLEGram features ported and organized in GLEGram/ folder.

Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass,
Font Replacement, Fake Profile, Chat Export, Plugin System, and more.

See CHANGELOG_12.5.md for full details.
2026-04-06 09:48:12 +03:00

56 lines
1.5 KiB
C++

#ifndef Shape_hpp
#define Shape_hpp
#include "Lottie/Private/Model/ShapeItems/ShapeItem.hpp"
#include "Lottie/Private/Model/ShapeItems/Ellipse.hpp"
#include <LottieCpp/BezierPath.h>
#include "Lottie/Private/Parsing/JsonParsing.hpp"
#include <optional>
namespace lottie {
/// An item that defines an custom shape
class Shape: public ShapeItem {
public:
explicit Shape(lottiejson11::Json::object const &json) noexcept(false) :
ShapeItem(json),
path(KeyframeGroup<BezierPath>(getObject(json, "ks"))) {
if (const auto directionRawValue = getOptionalInt(json, "d")) {
switch (directionRawValue.value()) {
case 1:
direction = PathDirection::Clockwise;
break;
case 2:
direction = PathDirection::UserSetClockwise;
break;
case 3:
direction = PathDirection::CounterClockwise;
break;
default:
throw LottieParsingException();
}
}
}
virtual ~Shape() = default;
virtual void toJson(lottiejson11::Json::object &json) const override {
ShapeItem::toJson(json);
json.insert(std::make_pair("ks", path.toJson()));
if (direction.has_value()) {
json.insert(std::make_pair("d", (int)direction.value()));
}
}
public:
KeyframeGroup<BezierPath> path;
std::optional<PathDirection> direction;
};
}
#endif /* Shape_hpp */