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

Color of key vertices not preserved when opening #92

Open
dalboris opened this issue Nov 4, 2018 · 0 comments
Open

Color of key vertices not preserved when opening #92

dalboris opened this issue Nov 4, 2018 · 0 comments

Comments

@dalboris
Copy link
Owner

dalboris commented Nov 4, 2018

Currently, when opening a file, all key vertices are made black (= rgba(0, 0, 0, 1) ), regardless of their color attribute.

For example, the examples/vpaint-1.6/torus.vec file has key vertices with the color rgba(0, 0, 255, 1) (which makes no sense and was probably another bug... but anyway), and when opening and saving this file, the color becomes rgba(0, 0, 0, 1). The expected behavior would be to preserve the original color.

I've tracked down the issue, here is what happens:

  1. VAC::read(xml) calls new KeyVertex(this, xml);
  2. which first calls the base constructor Cell(vac, xml)
  3. which correctly sets color_ from the value in the file
  4. but then the derived constructor KeyVertex(vac, xml) is called
  5. which calls KeyVertex::initColor()
void KeyVertex::initColor()
{
    color_[0] = 0;
    color_[1] = 0;
    color_[2] = 0;
    color_[3] = 1;
}

I suspect that I did this on purpose do handle incorrect values in the example files, but what I should do is fix the examples and preserve vertices color when reading a file (even though this color is never used currently, since vertices are only visible in topology mode or when highlighted/selected, in which situations they are displayed in another color anyway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant