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

BUG: Multiple images can have the same name #87

Open
Onetchou opened this issue Apr 20, 2024 · 0 comments
Open

BUG: Multiple images can have the same name #87

Onetchou opened this issue Apr 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Onetchou
Copy link
Owner

"isUnique(name) in the nameLineEdit works if you compare an image name to a point name, but not if you name 2 images the same because we're not adding the image as a VGObject so the image name is not unique.
So in the image_tool we’re going to need to define an image GOType, create a VGObject, and call

enum class GOType : char {Point, Arc, EllipticalArc, Spline, SplinePath, CubicBezier, CubicBezierPath, Unknown, Curve, Path, AllCurves, Image};

VGObject::VGObject(const GOType &type, const quint32 &idObject, const Draw &mode)
    :d(new VGObjectData(type, idObject, mode))
quint32 VContainer::AddGObject(VGObject *obj) 
{
    SCASSERT(obj != nullptr)
    QSharedPointer<VGObject> pointer(obj);
    uniqueNames.insert(obj->name());
    return AddObject(d->gObjects, pointer);
}

This will add the object and thus the name to the list of unique names. Then when you call IsUnique(name), it can compare the image name against the uniqueNames list that would include any images."

@Onetchou Onetchou added the bug Something isn't working label Apr 20, 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