Skip to content

Commit

Permalink
Disable brush autofill when erasing (#4729)
Browse files Browse the repository at this point in the history
* disable brush autofill when erasing

* update changelog
  • Loading branch information
MichaelBuessemeyer authored Jul 23, 2020
1 parent af257cd commit fa8fc60
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
-

### Changed
-
- Disabled the autofill feature of the brush when using this tool to erase data. [#4729](https://github.com/scalableminds/webknossos/pull/4729)

### Fixed
-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ export function* editVolumeLayerAsync(): Generator<any, any, any> {
const contourTracingMode = yield* select(
state => enforceVolumeTracing(state.tracing).contourTracingMode,
);
const isDrawing =
contourTracingMode === ContourModeEnum.DRAW_OVERWRITE ||
contourTracingMode === ContourModeEnum.DRAW;

// Volume tracing for higher zoomsteps is currently not allowed
if (yield* select(state => isVolumeTracingDisallowed(state))) {
Expand Down Expand Up @@ -118,7 +121,10 @@ export function* editVolumeLayerAsync(): Generator<any, any, any> {
// if the current viewport does not match the initial viewport -> dont draw
continue;
}
if (activeTool === VolumeToolEnum.TRACE || activeTool === VolumeToolEnum.BRUSH) {
if (
activeTool === VolumeToolEnum.TRACE ||
(activeTool === VolumeToolEnum.BRUSH && isDrawing)
) {
currentLayer.addContour(addToLayerAction.position);
}
if (activeTool === VolumeToolEnum.BRUSH) {
Expand Down

0 comments on commit fa8fc60

Please sign in to comment.