Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the inspection of the TTF component #5

Open
Gallasko opened this issue Oct 14, 2024 · 0 comments
Open

Fix the inspection of the TTF component #5

Gallasko opened this issue Oct 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Gallasko
Copy link
Owner

In the editor, view a different TTF component one after the other make the editor crash !

May possibly be a missmatch between deserialization and component creation:
in ttftext.cpp

    template <>
    void serialize(Archive& archive, const TTFText& value)
    {
        archive.startSerialization(TTFText::getType());

        serialize(archive, "text", value.text);
        serialize(archive, "size", value.textSize);
        serialize(archive, "colors", value.colors);
        serialize(archive, "fontPath", value.fontPath);

        archive.endSerialization();
    }

    template <>
    TTFText deserialize(const UnserializedObject& serializedString)
    {
        LOG_THIS(DOM);

        std::string type = "";

        if (serializedString.isNull())
        {
            LOG_ERROR(DOM, "Element is null");
        }
        else
        {
            LOG_INFO(DOM, "Deserializing Sentence Text");

            TTFText data;

            data.text = deserialize<std::string>(serializedString["text"]);
            data.textSize = deserialize<int>(serializedString["size"]);
            data.colors = deserialize<constant::Vector4D>(serializedString["colors"]);
            data.fontPath = deserialize<std::string>(serializedString["fontPath"]);

            return data;
        }

        return TTFText{};
    }
@Gallasko Gallasko added the bug Something isn't working label Oct 14, 2024
@Gallasko Gallasko changed the title [Crash] Fix the inspection of the TTF component Fix the inspection of the TTF component Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant