Core: avoid conversion from float to double or vice-versa
When synchronizing the Transparency property with the transparency value of the ShapeAppearance property then do not convert between float and double as otherwise some strange rounding issues can occur. Example: Set the Transparency property of an object to 35 in the Property Editor. After leaving the editor the value may switch to 34.
This commit is contained in:
@@ -149,7 +149,7 @@ void ViewProviderGeometryObject::onChanged(const App::Property* prop)
|
||||
getObject()->touch(true);
|
||||
}
|
||||
const App::Material& Mat = ShapeAppearance[0];
|
||||
long value = (long)(100.0 * ShapeAppearance.getTransparency() + 0.5);
|
||||
long value = (long)(100.0 * ShapeAppearance.getTransparency());
|
||||
if (value != Transparency.getValue()) {
|
||||
Transparency.setValue(value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user