Thread Tools Display Modes
09-11-15, 05:04 PM   #1
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Backdrop and resizable/movable frames

I have a frame using this backdrop:
Lua Code:
  1. local Backdrop = {
  2.    bgFile      = db.PATH.."BackdropBG",
  3.    edgeFile    = db.PATH.."BackdropEdge",
  4.    edgeSize    = 8,
  5.    insets      = {left = 8, right = 8, top = 8, bottom = 8}
  6. }

The edge file is made up of 8x8 tiles and is correctly configured, however, when the frame can be moved and resized, the backdrop doesn't always draw correctly. Any idea why this is happening, and if so, a way to circumvent or even prevent it?

It looks like it moves one line from the top edge to the bottom edge, or occassionally it moves a line from the left edge to the right edge.

Correct:


Incorrect:
__________________

Last edited by MunkDev : 09-11-15 at 08:28 PM.
  Reply With Quote
09-11-15, 08:29 PM   #2
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Here's a gif, vaguely showing the issue inside a moving scrollframe:

Quality is bad, but good enough to spot the flickering edge file.
__________________
  Reply With Quote
09-12-15, 05:56 AM   #3
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
That gif is hard to follow with the bouncing. It is just better to post with the code tags or Lua button.

Anyway, the error is simple: loc1 is presumably undefined, or if it is, your assignment of it is incorrect. Depending on what you want (can't see the rest of your code):
Code:
loc1 = 11
-- or
loc1 = loc1 + 11
  Reply With Quote
09-12-15, 06:00 AM   #4
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Originally Posted by myrroddin View Post
That gif is hard to follow with the bouncing. It is just better to post with the code tags or Lua button.

Anyway, the error is simple: loc1 is presumably undefined, or if it is, your assignment of it is incorrect. Depending on what you want (can't see the rest of your code):
Code:
loc1 = 11
-- or
loc1 = loc1 + 11
You didn't really read the thread at all, did you? :P
__________________
Grab your sword and fight the Horde!
  Reply With Quote
09-12-15, 07:34 AM   #5
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Originally Posted by myrroddin View Post
That gif is hard to follow with the bouncing. It is just better to post with the code tags or Lua button.

Anyway, the error is simple: loc1 is presumably undefined, or if it is, your assignment of it is incorrect. Depending on what you want (can't see the rest of your code):
Code:
loc1 = 11
-- or
loc1 = loc1 + 11
Lol! This is a lua IDE I'm working on. The error is intended to draw the error tooltip, which has the graphical error I can't figure out. I didn't think the OP was that wordy?
__________________
  Reply With Quote
09-12-15, 08:45 AM   #6
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Originally Posted by MunkDev View Post
Lol! This is a lua IDE I'm working on. The error is intended to draw the error tooltip, which has the graphical error I can't figure out. I didn't think the OP was that wordy?
Didn't realise you were referring to the tooltip in that GIF! That looks like it could be plain old aliasing from it being drawn on fractions of pixels.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
09-12-15, 08:52 AM   #7
Gethe
RealUI Developer
 
Gethe's Avatar
Premium Member
Featured
Join Date: Sep 2008
Posts: 942
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.
__________________
Knowledge = Power; Be OP

  Reply With Quote
09-12-15, 10:31 AM   #8
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
I've used

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

to fix borders with this issue on corner to corner offsets
  Reply With Quote

WoWInterface » Developer Discussions » Graphics Help » Backdrop and resizable/movable frames


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off