View Single Post
11-12-13, 05:47 AM   #6
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 454
@zork
That's why I'm curious why my code does not work. I also thought that OnShow should be sufficient but found out it isn't, that's why I hooked OnSizeChanged too. But somehow it still changes sizes and stays like that either with a visible lag (and changes then to the set height) or until the next cast or all the time for that given nameplate. So it somehow seems that my code behaves differently for the different nameplates and I just don't find any explanation for that.

However your approach is different than mine. I don't understand why you create "double" nameplates and re-parent stuff to them. You have a lot of overhead to it as you re-anchor all your double plates every second. What is the benefit of that?

@Oppugno
Doesn't make much sense but I'll try it

@Reslike
The reason for the size change is that the castbar gets re-anchored every OnShow (at least that's the earliest point where I can catch it) relative to the castbar border (that's castbarOverlay in my code). There is a single point set - "BOTTOMRIGHT", castbarOverlay, "BOTTOMRIGHT", xOffset, yOffset (don't know the values of the offsets off the top of my head). castbarOverlay itself is anchored to the center of the nameplate and don't seem to be movable (tried that and all SetPoint calls appear to get ignored). I need ClearAllPoints() before re-anchoring. Don't know why this should cause a problem, but well the nameplates code is C-side and hidden. I actually had tried to just replace the "BOTTOMRIGHT" anchor for the sake of optimization (thus sparing the ClearAllPoints() call) but this didn't prevent the strange resizing either.
  Reply With Quote