Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/component/helper/BrushController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ export interface BrushCoverConfig {
panelId?: string;

brushMode?: BrushMode;
// `brushStyle`, `transformable` is not mandatory, use DEFAULT_BRUSH_OPT by default.
// `brushStyle`, `transformable` is not mandatory. When the controller is enabled,
// `updateCovers` inherits from the current brush option first, and then falls back
// to `DEFAULT_BRUSH_OPT`.
brushStyle?: Pick<PathStyleProps, BrushStyleKey>;
transformable?: boolean;
removeOnClick?: boolean;
Expand Down Expand Up @@ -381,8 +383,9 @@ class BrushController extends Eventful<{
assert(this._mounted);
}

const baseBrushOption = this._brushOption || DEFAULT_BRUSH_OPT;
coverConfigList = map(coverConfigList, function (coverConfig) {
return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true);
return merge(clone(baseBrushOption), coverConfig, true);
}) as BrushCoverConfig[];

const tmpIdPrefix = '\0-brush-index-';
Expand Down
74 changes: 74 additions & 0 deletions test/ut/spec/component/helper/BrushController.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.