diff --git a/src/client/canvas.ts b/src/client/canvas.ts index 8bcb12f..0675f1e 100644 --- a/src/client/canvas.ts +++ b/src/client/canvas.ts @@ -359,6 +359,7 @@ export class ViewCanvas { this._getPlacerFn(x, y).then((placer) => { if (placer && this._placerRequestTime === order) { this._showPlacerTag(placer); + this.picker.setPickColor(placer.color); } }); } @@ -386,6 +387,7 @@ export class ViewCanvas { private _resetPlacerTag(): void { this._placerRequestTime = 0; + this.picker.setPickColor(null); if (this._placerTag) { this._cursor.removeChild(this._placerTag); this._placerTag = null; diff --git a/src/client/picker.ts b/src/client/picker.ts index 3aa6e8b..987afaa 100644 --- a/src/client/picker.ts +++ b/src/client/picker.ts @@ -5,6 +5,7 @@ import { $ } from './utils/dom'; export class Picker { private _fn?: (color: number) => void; private _color: number = 0x000000; + private _pickerColor: number | null = null; private _colorHistory: number[] = []; private _wrapper = $('
'); @@ -16,6 +17,7 @@ export class Picker { private _placebtn = $('