mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): use pixel bbox when image is in layer
This commit is contained in:
parent
7bbd25b5ec
commit
1e689a4902
@ -618,14 +618,16 @@ export class CanvasLayer {
|
|||||||
* - Eraser lines are normal lines, except they composite as transparency. Konva's getClientRect includes them when
|
* - Eraser lines are normal lines, except they composite as transparency. Konva's getClientRect includes them when
|
||||||
* calculating the bbox.
|
* calculating the bbox.
|
||||||
* - Clipped portions of lines will be included in the client rect.
|
* - Clipped portions of lines will be included in the client rect.
|
||||||
|
* - Images have transparency, so they will be included in the client rect.
|
||||||
*
|
*
|
||||||
* TODO(psyche): Using pixel data is slow. Is it possible to be clever and somehow subtract the eraser lines and
|
* TODO(psyche): Using pixel data is slow. Is it possible to be clever and somehow subtract the eraser lines and
|
||||||
* clipped areas from the client rect?
|
* clipped areas from the client rect?
|
||||||
*/
|
*/
|
||||||
for (const obj of this.objects.values()) {
|
for (const obj of this.objects.values()) {
|
||||||
const isEraserLine = obj instanceof CanvasEraserLine;
|
const isEraserLine = obj instanceof CanvasEraserLine;
|
||||||
|
const isImage = obj instanceof CanvasImage;
|
||||||
const hasClip = obj instanceof CanvasBrushLine && obj.state.clip;
|
const hasClip = obj instanceof CanvasBrushLine && obj.state.clip;
|
||||||
if (isEraserLine || hasClip) {
|
if (isEraserLine || hasClip || isImage) {
|
||||||
needsPixelBbox = true;
|
needsPixelBbox = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user