mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
tidy(ui): misc cleanup
This commit is contained in:
@@ -65,6 +65,9 @@ export class CanvasEntityLayerAdapter extends CanvasModuleBase {
|
||||
*/
|
||||
renderer: CanvasEntityRenderer;
|
||||
|
||||
/**
|
||||
* Whether this is the first render of the entity layer.
|
||||
*/
|
||||
isFirstRender: boolean = true;
|
||||
|
||||
constructor(state: CanvasEntityLayerAdapter['state'], manager: CanvasEntityLayerAdapter['manager']) {
|
||||
@@ -101,7 +104,7 @@ export class CanvasEntityLayerAdapter extends CanvasModuleBase {
|
||||
return getEntityIdentifier(this.state);
|
||||
};
|
||||
|
||||
update = async (arg?: { state: CanvasEntityLayerAdapter['state'] }) => {
|
||||
update = async (arg?: { state: CanvasEntityLayerAdapter['state'] }): Promise<void> => {
|
||||
const state = get(arg, 'state', this.state);
|
||||
|
||||
const prevState = this.state;
|
||||
@@ -164,7 +167,6 @@ export class CanvasEntityLayerAdapter extends CanvasModuleBase {
|
||||
};
|
||||
|
||||
getCanvas = (rect?: Rect): HTMLCanvasElement => {
|
||||
// TODO(psyche) - cache this - maybe with package `memoizee`? Would require careful review of cache invalidation
|
||||
this.log.trace({ rect }, 'Getting canvas');
|
||||
// The opacity may have been changed in response to user selecting a different entity category, so we must restore
|
||||
// the original opacity before rendering the canvas
|
||||
|
||||
@@ -164,7 +164,6 @@ export class CanvasEntityMaskAdapter extends CanvasModuleBase {
|
||||
};
|
||||
|
||||
getCanvas = (rect?: Rect): HTMLCanvasElement => {
|
||||
// TODO(psyche): Cache this?
|
||||
// The opacity may have been changed in response to user selecting a different entity category, and the mask regions
|
||||
// should be fully opaque - set opacity to 1 before rendering the canvas
|
||||
const attrs: GroupConfig = { opacity: 1 };
|
||||
|
||||
@@ -30,7 +30,7 @@ export class CanvasEraserToolPreview extends CanvasModuleBase {
|
||||
manager: CanvasManager;
|
||||
log: Logger;
|
||||
|
||||
config: EraserToolPreviewConfig;
|
||||
config: EraserToolPreviewConfig = DEFAULT_CONFIG;
|
||||
|
||||
konva: {
|
||||
group: Konva.Group;
|
||||
@@ -39,14 +39,13 @@ export class CanvasEraserToolPreview extends CanvasModuleBase {
|
||||
outerBorder: Konva.Ring;
|
||||
};
|
||||
|
||||
constructor(parent: CanvasToolModule, config?: Partial<EraserToolPreviewConfig>) {
|
||||
constructor(parent: CanvasToolModule) {
|
||||
super();
|
||||
this.id = getPrefixedId(this.type);
|
||||
this.parent = parent;
|
||||
this.manager = this.parent.manager;
|
||||
this.path = this.manager.buildPath(this);
|
||||
this.log = this.manager.buildLogger(this);
|
||||
this.config = { ...DEFAULT_CONFIG, ...config };
|
||||
|
||||
this.log.debug('Creating module');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user