Open Sparker95 opened 5 years ago
The control is aligning to the grid, but the positions and scale are changing because of the floating point arithmetic rounding errors with translating. ADC renders with 2 x coordinates (x1, x2) and 2 y coordinates (y1,y2) rather than x,y,w,h. With translating, it has to recalculate x1,y1,x2,y2 rather than just x and y with width and height being untouched. Since there is a rounding error in preserving the original scale (width and height), the x and y positions need to be different to compensate for the lost (or gained) pixels.
I agree though, there shouldn't be a rounding error or weird amounts of precision when using a grid. ADC 2019.1.0 is introducing enormous changes to the grid and this should be an added tweak.
On Tue, May 7, 2019, 07:49 Saveliy Tronza notifications@github.com wrote:
Version and Build
Version 1.0.7 Summary
UI coordinates do not align to grid Detail
Hi! Let's say we have selected 1% grid and aligned all the coordinates of our button as integer values of 0.01 like this:
safeZoneX + safeZoneW 0.72 safeZoneY + safeZoneH 0.26 safeZoneW 0.04 safeZoneH 0.06
We drag it around a few times, resize it, and that's what I get:
safeZoneX + safeZoneW 0.53177084 safeZoneY + safeZoneH 0.46388889 safeZoneW 0.06979167 safeZoneH 0.06944445
You see how big the accumulated error is!
I think that there should be a button 'align to grid'. It exists in every program I have seen that deals with grids in similar manner. When user clicks the button, all coordinates of selected controls get rounded to nearest values that correspond to grid. Ideally we would want this to happen automatically during movement/resize operations, otherwise what's the point of the grid.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kayler-renslow/arma-dialog-creator/issues/47, or mute the thread https://github.com/notifications/unsubscribe-auth/AD565IONJEN4YVRTVLL3UQDPUF3HDANCNFSM4HLIP5RQ .
Thanks for your reply! Really looking forward to these changes!
I would really like to have a look at the code that does these calculations, just for my interest. The gained error seems insanely huge to me. Several resizes have accumulated around 1%. Maybe something somewhere is being truncated/rounded off too early?
I have been using different PCB layout programs before and they must have solved the problem somehow, because they often let you have some object being offset from grid but still move with proper steps. There's a open source program called KiCAD, maybe we could have a look how they handle the coordinate problems there (I guess they just use doubles).
The calculations are kind of all over the place lol. Here are the key files
@kayler-renslow
Any update on this being fixed, or 2019 v1.0 showing itself?
I spend hours aligning controls, only to find that once exported to my Arma Project they display all over the place. Manually tweaking the x.y.w.h cords in the tool, rounding them up to the grid, is extremely laborious and even then, quiet often, they still do not display as expected in Arma.
If you have abandoned the project, please reply and let us know. At least then I can seek a.n.other tool (even though yours is easily my tool of choice)
Development is slow at the moment on v2019, but it is still in the works.
I spend hours aligning controls, only to find that once exported to my Arma Project they display all over the place. Manually tweaking the x.y.w.h cords in the tool, rounding them up to the grid, is extremely laborious and even then, quiet often, they still do not display as expected in Arma.
This shouldn't be happening (if it is, it's a problem). Are you using safezone values (i.e. safezoneX * 0.25
)?
Yes, I am using safezoneX etc.
My symptoms are exactly the same as described by the OP.
Sample screen shot from ADC
As displayed in Arma 3
Yea there's definitely a rounding error happening there when calculating the pixel positions. The Teleport
and Commander
boxes are a bit misaligned since ADC doesn't have very precise Font rendering. But overall, this isn't as bad as I pictured in my head. There's definitely work to be done here though and the layout system in the upcoming version will hopefully address the rounding error.
Any update on this being fixed? Has the application been abandoned? You safe from covid?
I'm fine lol. I was working on a big update in 2019 and 2020 but I can't muster enough energy to be productive on this project anymore so I'd classify it as abandoned. Sorry.
I'm fine lol. I was working on a big update in 2019 and 2020 but I can't muster enough energy to be productive on this project anymore so I'd classify it as abandoned. Sorry.
It's fine Kayler, thank you for making this tool <3
Any thoughts on this going open source if you don't want to work on it anymore?
It's always been open source under MIT license.
Version and Build
Version 1.0.7
Summary
UI coordinates do not align to grid
Detail
Hi! Let's say we have selected 1% grid and aligned all the coordinates of our button as integer values of 0.01 like this:
We drag it around a few times, resize it, and that's what I get:
You see how big the accumulated error is!
I think that there should be a button 'align to grid'. It exists in every program I have seen that deals with grids in similar manner. When user clicks the button, all coordinates of selected controls get rounded to nearest values that correspond to grid. Ideally we would want this to happen automatically during movement/resize operations, otherwise what's the point of the grid.