Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI coordinates do not align to grid #47

Open
Sparker95 opened this issue May 7, 2019 · 12 comments
Open

UI coordinates do not align to grid #47

Sparker95 opened this issue May 7, 2019 · 12 comments

Comments

@Sparker95
Copy link

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.

@kayler-renslow
Copy link
Owner

kayler-renslow commented May 7, 2019 via email

@Sparker95
Copy link
Author

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).

@kayler-renslow
Copy link
Owner

kayler-renslow commented May 7, 2019

The calculations are kind of all over the place lol. Here are the key files

@OfficialStamper
Copy link

OfficialStamper commented Nov 7, 2019

@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)

@kayler-renslow
Copy link
Owner

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)?

@OfficialStamper
Copy link

Yes, I am using safezoneX etc.

My symptoms are exactly the same as described by the OP.

Sample screen shot from ADC
image

As displayed in Arma 3
image

@kayler-renslow
Copy link
Owner

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.

@hypoxia125
Copy link

Any update on this being fixed? Has the application been abandoned? You safe from covid?

@kayler-renslow
Copy link
Owner

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.

@Sparker95
Copy link
Author

Sparker95 commented Mar 27, 2021

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

@hypoxia125
Copy link

hypoxia125 commented Mar 29, 2021

Any thoughts on this going open source if you don't want to work on it anymore?

@kayler-renslow
Copy link
Owner

It's always been open source under MIT license.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants