Skip to content

Commit 029ee90

Browse files
psychedelicioushipsterusername
authored andcommitted
docs(ui): add comment & TODO for konva bug
1 parent 2f9a064 commit 029ee90

File tree

1 file changed

+6
-0
lines changed
  • invokeai/frontend/web/src/features/controlLayers/util

1 file changed

+6
-0
lines changed

invokeai/frontend/web/src/features/controlLayers/util/renderers.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,9 @@ const updateInitialImageLayerImageAttrs = (
483483
konvaImage: Konva.Image,
484484
reduxLayer: InitialImageLayer
485485
) => {
486+
// Konva erroneously reports NaN for width and height when the stage is hidden. This causes errors when caching,
487+
// but it doesn't seem to break anything.
488+
// TODO(psyche): Investigate and report upstream.
486489
const newWidth = stage.width() / stage.scaleX();
487490
const newHeight = stage.height() / stage.scaleY();
488491
if (
@@ -618,6 +621,9 @@ const updateControlNetLayerImageAttrs = (
618621
reduxLayer: ControlAdapterLayer
619622
) => {
620623
let needsCache = false;
624+
// Konva erroneously reports NaN for width and height when the stage is hidden. This causes errors when caching,
625+
// but it doesn't seem to break anything.
626+
// TODO(psyche): Investigate and report upstream.
621627
const newWidth = stage.width() / stage.scaleX();
622628
const newHeight = stage.height() / stage.scaleY();
623629
const hasFilter = konvaImage.filters() !== null && konvaImage.filters().length > 0;

0 commit comments

Comments
 (0)