Skip to content

Fix layered portrait preview after empty portraits - #2827

Open
upalvstavai wants to merge 1 commit into
dialogic-godot:mainfrom
upalvstavai:codex/fix-empty-layered-portrait
Open

upalvstavai wants to merge 1 commit into
dialogic-godot:mainfrom
upalvstavai:codex/fix-empty-layered-portrait

Conversation

@upalvstavai

Copy link
Copy Markdown

An empty layered portrait could cache a zero-sized coverage rectangle. The character editor then divided by that empty size while fitting the preview, producing an invalid scale. Because sprite bounds were also measured through global transforms, that invalid preview scale prevented a later inherited texture from recovering the portrait preview.

This change:

  • computes sprite bounds relative to the layered portrait from all four transformed corners;
  • avoids caching empty coverage so a later inherited texture can populate it;
  • guards the character editor against empty or non-finite fit rectangles.

Validation:

  • Added regression coverage for an initially empty portrait that later inherits a 24x40 texture
  • Added coverage for an invalid root scale while calculating portrait bounds
  • gdUnit4: 2/2 tests passed, with no failures, errors, or orphan nodes

Closes #2822

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Empty Portrait Position Inheritance (Godot 4.7.2, Dialogic 2.0 Alpha 20)

1 participant