View Single Post
06-09-17, 06:35 AM   #9
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Originally Posted by Resike View Post
This frame can be moved/resized on the fly, and it keeps it's pixel perfection sizes on all of it's elements all the time, even after any (SetSize|SetWidth|SetHeight|SetPoint) calls.
WOW!!

So the core of part of the example would be:

Lua Code:
  1. local left, bottom = self:GetLeft(), self:GetBottom()
  2.  
  3. if left and bottom then
  4.     local x = math.round(left)
  5.     local y = math.round(-UIParent:GetHeight() + bottom + self:GetHeight())
  6.  
  7.     self:ClearAllPoints()
  8.     self:SetPoint("TOPLEFT", UIParent, "TOPLEFT", x, y)
  9. end

as you've explained on previous comment.

What if the parent of such frame is not UIParent, but another frame?

Would L#5 and L#8 still be same? or should I change UIParent to another parent frame that we create?

+

I've been digging codes out of ElvUI and it also has some variables and functions about pixel perfect.

Would that be a relevant info here? If so, do you have any clues regarding what it actually does?

Last edited by Layback_ : 06-09-17 at 07:03 AM.
  Reply With Quote