Skip to content

Commit 7d6524e

Browse files
authored
Merge pull request #21590 from apache/codex/fix-21583-area-select-style
fix(parallel): preserve areaSelectStyle on persisted selection
2 parents c8adaf4 + 0c0f466 commit 7d6524e

2 files changed

Lines changed: 79 additions & 2 deletions

File tree

src/component/helper/BrushController.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ export interface BrushCoverConfig {
7272
panelId?: string;
7373

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

386+
const baseBrushOption = this._brushOption || DEFAULT_BRUSH_OPT;
384387
coverConfigList = map(coverConfigList, function (coverConfig) {
385-
return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true);
388+
return merge(clone(baseBrushOption), coverConfig, true);
386389
}) as BrushCoverConfig[];
387390

388391
const tmpIdPrefix = '\0-brush-index-';

test/ut/spec/component/helper/BrushController.test.ts

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)