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

Y-Positioning is Broken #39

Open
repomaa opened this issue Jun 4, 2016 · 3 comments
Open

Y-Positioning is Broken #39

repomaa opened this issue Jun 4, 2016 · 3 comments

Comments

@repomaa
Copy link

repomaa commented Jun 4, 2016

See the following input strings:

^r(5x6)^p(;5)^r(5x6)
^r(5x8)^p(;4)^r(5x8)
^r(5x12)^p(;2)^r(5x12)

All of them draw two rectangles at the same height. The y-position to achieve this (apart from leaving the positioning out obviously) seems very random. This makes it impossible to draw vertical progress bars.

@poinck
Copy link

poinck commented Jun 4, 2016

I tried following, I am not sure, why ^(p;26) is needed for correct alignment; I expected it to be ^p(;24); must be that default margin of 1 pixel. You notice that I substracted the hight from the next rectangle from the one before to get the relative positioning for the next rectangle. I colorized the third rectangle just for testing.

# 8-20=-12 20-38=-18 and so on
echo "^p(;26)^r(5x8)^p(;-12)^r(5x20)^p(;-18)^fg(#ff0000)^r(5x38)^p(;24)^fg()^r(5x10)" | dzen -h 48 -p

I wonder, if "_LOCK_X" can help. Can't get it to work.

@repomaa
Copy link
Author

repomaa commented Jun 5, 2016

Yes, substracting the height of the current rectangle from the previous one is what i tried as well. The ^p(;26) is indeed curious. Were you able to get it to work for any other initial height? I played around a bit but had no luck.

@poinck
Copy link

poinck commented Jun 6, 2016

Because I am using a vertical panel with horizontal bars, I can use absolute positioning with ^pa(), and never had a problem with it.

Maybe someone who uses relative positioning more regularly can help here.

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

No branches or pull requests

2 participants