WeakAuras

WeakAuras

204M Downloads

Border Offset being applied wrong when Width and/or Height are Odd Numbers (gets weirder when X and/or Y are also odd numbered)

bigsaddev opened this issue ยท 1 comments

commented

Description

I've been having this problem for a couple months now and couldn't find out why the borders I applied were offset, often by one pixel.
This has both been affecting Icons and Progress Bars. I've not tested other auras for similar behavior.
X and Y Values used were just places I've had enough space for screenshots, the only impact the X and Y values have are if they're odd numbered(while the height or width is also odd numbered, but I'd need further testing to confirm).

This is a progress bar showing the issue.

Relevant Position Settings(X, Y, W, H)

  • X: -340
  • Y: -260
  • W: 200
  • H: 21

Border Settings

  • Border Style: 1 Pixel
  • Border Offset: 0
  • Border Size: 1
  • Border Anchor: Full
    image

You can probably see from the position settings that there is an "oddity", being the height.

Here is the same Progress Bar, almost the same settings as before, the only thing that has changed is the height, which is now just one pixel less at 20. (This is how it should look like)
image

Here's another oddity, if we apply the initial settings(X: -340, Y: -260, W: 200, H:21) and now add one pixel to the Y value, the offset appears on two sides.
image

You can achieve similar results for other sides of the progress bar by changing the width.

I'll now demonstrate similar behavior for Icons and I assume some of this will also apply to Progress Bars.

I've prepared a Dynamic Group with 4 Icons inside which all have a Border using the same settings in the Progress Bar.
This is how it should look like

Border Settings

  • Border Style: 1 Pixel
  • Border Offset: 0
  • Border Size: 1

Icon Settings

  • Icon Size; W: 32, H: 32
  • X, Y Offset: 0

Dynamic Group Settings

  • Grow: Centered Horizontal
  • Space: 2
  • X: -340
  • Y: -260
    image

If we now change the Space of the Dynamic Group from 2 to 1, we get this.
image

It's a bit hard to see, probably easiest on the 2nd one from the left.
The offset is back because the X position has changed and is now odd numbered.

WeakAuras Version

5.3.7

World of Warcraft Flavor

Retail (Default)

Tested with only WeakAuras

  • Yes
  • No

Lua Error

No response

Reproduction Steps

  1. Create ProgressBar or Icon
  2. Apply a Border(Style: 1 Pixel, similar other styles should produce the same result) with 0 Offset, Size 1
  3. Change the Width or Height to an odd number
  4. You should see the problem i've described

You can get the border to look weirder by also changing the X or Y value(depending on if you changed W or H), if you changed both W and H to be odd, you can get even weirder results by changing both X and Y to be odd

Last Good Version

No response

Screenshots

No response

Export String

!WA:2!TJ5w3TXvzy4QQAkDsOKiAttAsBNukf7sDWYhuItOfKKLSLJILYizNdKG1inBPzKhnZ49mYYwqHw30GH1QalFbNAbkcAHcLtcw8di)c(w(AUkxWAXLK)aW3EpZilFSooTaRU4gnAoV3VVpFV79EcmtiBPro1qN60HQfsjKYkp5AfLlnNc10kUPUjDYGbdMn4aNAeRqLmnCOM66eL4QA6kuIX32k0eMne1CeTvnRRRiQBAohnNLCjIyyRdNnMy)Ix6SIHhDuXjWnrAXpc7VJS1ZoI1X2YHEEXRCwX(hoS1tUnN6Y4g(5Je2AOE3AdPpr)BAWbgWTbWVPb430zg42fnPkeAmVUR1HIPR1SPmvrmVPPUJMLKDjzDsWIUxNAl3TjuQqSoCU5RltjIjRRRlEjvnhslkPIMPr(LSisvOM1T8U8CAnj90YXS0ceQnEbhnWnF72UNYvGdeiqWIO2wwRIaDXmLlBtCcqLl5GxSDejBhzQJqXYAgA2QcXWnocl7q1QubFEp(Zs9(7nBPqkwVCz27NorI0ztoD6yoSgJCDQ8GlBBr01tPylCB76fjlqmCYHxT2ITNnE0C5Nnx(Os5JvhF4fT0LxIqLmKRrSfK4xAXjiY6oQDU1SucERs5YMiD6vRB41eeOl516VJMHdHAiRpJBF(vAlBus1KM1eprX4jMkFcPvLn0QjZ6KrGhp5TiY2KCoitvXr9bHtgZW0GSMc20zxXSSoc1MGQKI9YSlL1nHHJvtwZijmeEdWWWiqe4042JV5J80AkwhlpX2rZOI44O3yOiw2KkoUMJA9IT1mWDCBkcTltX(n2qKDKdEh3wDs2HyVWI5IlLiXuRjx3bpCglUdj4zMPmWEEWB5UJRo8qTqbtIJf2cRAt0lZfaiClwhrZ92JPBkRKSOdsAgohrQwDK8eIH2vPJajfKkPlBBZ(xmBeKy)zW6AkTNB(Xsg1zOK5ZUqOsV1Hwj8QY0sP5Q3noceCsSie9BXWEBh0B7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W9752VDtDWKQ)QRO)l5Sk8laIRW3j3i9gK(7UGbFj)EipyDFI1l(4B1PqhIzuBFn(tTBJa65uyx2V3JOX70D5OVU)USQnUw)EDkS817ZTv9EZW)srQmZejs2C0elTj43x93eYZ(0tV59)bkYVV5XDVobLDM6V9tABVuNWkfXEpsivv3fKx5crgRwJuxykPoiVZoH8mq5H4(W2H8mO(9J5)BbVR1(DJ9)GiU5UcIrP8Ob9vqSB7jamLJPhOS4PCmrAZshFXiE4lYIO43CkJPkpDMO1tVZ47(EfhBu5pyp)puAZbUltBo5)vtBUHxAJ58vxO4WPt33PRSRPnHw4bEP)n
commented

That's because by your anchor choices and size choices that results in the border lying exactly between two pixels. If you want to have a pixel-perfect ui, you need to ensure that your resulting settings don't position elements on whole pixels.