vpaint
vpaint copied to clipboard
Color of key vertices not preserved when opening
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:
-
VAC::read(xml)
callsnew KeyVertex(this, xml);
- which first calls the base constructor
Cell(vac, xml)
- which correctly sets
color_
from the value in the file - but then the derived constructor
KeyVertex(vac, xml)
is called - 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).