View Single Post
09-12-15, 01:56 PM   #9
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Originally Posted by Gethe View Post
This is a general issue with single pixel lines. As the tooltip moves, the border will occasionally get between pixels which results in that line becoming dimmer.

One way you can work around this is ensuring that 1) both the width and height are whole numbers and 2) the frame is positioned on whole pixels. Using floor() and/or ceil() can help in both cases.

Also, if you're not anchoring corner to corner, you may need to add .5.
By corner to corner, do you mean e.g. anchoring to top left of UIParent?
I tried applying this:
Lua Code:
  1. local function EditorStopMoveSize()
  2.     Editor:StopMovingOrSizing()
  3.     if  Editor.isSizing then
  4.         local width, height = Editor:GetSize()
  5.         Editor:SetSize(ceil(width), ceil(height))
  6.     elseif Editor.isMoving then
  7.         local point, _, _, x, y = Editor:GetPoint()
  8.         Editor:SetPoint(point, ceil(x), ceil(y))
  9.     end
  10.     Editor.isSizing = false
  11.     Editor.isMoving = false
  12. end

However, the problem remains. Adding .5 at the end of each calculation doesn't do the trick either.

Originally Posted by ObbleYeah View Post
I've used

Lua Code:
  1. UIParent:GetScale()/frame:GetEffectiveScale()

to fix borders with this issue on corner to corner offsets
Could you elaborate? This always returns 1 for me when fed with the frame I want to correct.
__________________

Last edited by MunkDev : 09-12-15 at 03:07 PM.
  Reply With Quote