This commit is contained in:
Philip Rosedale 2014-02-06 08:55:52 -08:00
commit 96e8f339f5
2 changed files with 9 additions and 2 deletions

View file

@ -1256,7 +1256,8 @@ void Application::mousePressEvent(QMouseEvent* event) {
pasteVoxels();
}
if (MAKE_SOUND_ON_VOXEL_CLICK && _isHoverVoxel && !_isHoverVoxelSounding) {
if (!Menu::getInstance()->isOptionChecked(MenuOption::VoxelDeleteMode) &&
MAKE_SOUND_ON_VOXEL_CLICK && _isHoverVoxel && !_isHoverVoxelSounding) {
_hoverVoxelOriginalColor[0] = _hoverVoxel.red;
_hoverVoxelOriginalColor[1] = _hoverVoxel.green;
_hoverVoxelOriginalColor[2] = _hoverVoxel.blue;

View file

@ -54,6 +54,8 @@ void VoxelTreeElement::splitChildren() {
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
addChildAtIndex(i)->setColor(ourColor);
}
nodeColor noColor = { 0, 0, 0, 0};
setColor(noColor); // set our own color to noColor so we are a pure non-leaf
}
}
@ -143,7 +145,11 @@ void VoxelTreeElement::setColor(const nodeColor& color) {
memcpy(&_currentColor,&color,sizeof(nodeColor));
}
_isDirty = true;
_density = 1.0f; // If color set, assume leaf, re-averaging will update density if needed.
if (color[3]) {
_density = 1.0f; // If color set, assume leaf, re-averaging will update density if needed.
} else {
_density = 0.0f;
}
markWithChangedTime();
}
}