Skip to content

Conversation

@emptyrivers
Copy link
Contributor

This is actually 2 problems in one:

  • On initial spinup, our PRD anchor doesn't have a valid rect for 1 frame which would be fine, except we're creating it in the same frame we're anchoring dynamic groups to it. Thus, the dynamic group's children also won't have a valid rect. Fix this by forcing an early draw of the PRD anchor via an explicit GetSize call. (see https://warcraft.wiki.gg/wiki/API_ScriptRegion_IsRectValid for more details)
  • After initial spinup, our PRD anchor is anchored to NamePlate1 (or something that's attached to it, depending on user's addons). Unfortunately for us, Blizzard in their extremely finite wisdom decided to make NamePlate1 a restricted region. Thus, calls to GetRect & friends on any frame in its anchor family will error. This went unnoticed because we explicitly suppress errors on this to avoid user shenanigans breaking WeakAuras. Fix this problem by checking if GetLeft errors: if so, temporarily reanchor the dynamic group to UIParent before computing a new rect for it.

Fixes #5023

@emptyrivers emptyrivers added the 🏨 Bugfix This pull request fixes an issue. label Apr 28, 2024
@emptyrivers emptyrivers requested a review from InfusOnWoW April 28, 2024 22:58
@InfusOnWoW
Copy link
Contributor

I think that's on the reasonable side as far as hacks is concerned. It's doesn't look that complicated, so yeah I think we should add that.

This is actually 2 problems in one:

- On initial spinup, our PRD anchor doesn't have a valid rect for 1 frame
  which would be fine, except we're creating it in the same frame we're
  anchoring dynamic groups to it. Thus, the dynamic group's children
  also won't have a valid rect. Fix this by forcing an early draw of the
  PRD anchor via an explicit GetSize call.
  (see https://warcraft.wiki.gg/wiki/API_ScriptRegion_IsRectValid for more details)
- After initial spinup, our PRD anchor is anchored to NamePlate1
  (or something that's attached to it, depending on user's addons).
  Unfortunately for us, Blizzard in their extremely finite wisdom
  decided to make NamePlate1 a restricted region. Thus, calls to GetRect
  & friends on any frame in its anchor family will error. This went unnoticed
  because we explicitly suppress errors on this to avoid user shenanigans
  breaking WeakAuras. Fix this problem by checking if GetLeft errors:
  if so, temporarily reanchor the dynamic group to UIParent before computing
  a new rect for it.

Fixes WeakAuras#5023
@emptyrivers emptyrivers force-pushed the stupid_prd_problems branch from f5e59ef to 3fc5d0d Compare May 2, 2024 19:51
@emptyrivers emptyrivers added the 🆕 Feature Preview This is a draft intended to show a preview of an upcoming feature. label May 3, 2024
@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2024

An experimental build of WeakAuras with the changes in this pull request is available here.

@emptyrivers emptyrivers removed the 🆕 Feature Preview This is a draft intended to show a preview of an upcoming feature. label May 3, 2024
@InfusOnWoW InfusOnWoW merged commit 7859d5e into WeakAuras:main May 4, 2024
@emptyrivers emptyrivers deleted the stupid_prd_problems branch May 8, 2024 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏨 Bugfix This pull request fixes an issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transitive anchors are incorrect when root frame is anchored to PRD while loading for a specific spec

2 participants