dzen icon indicating copy to clipboard operation
dzen copied to clipboard

Y-Positioning is Broken

Open repomaa opened this issue 8 years ago • 3 comments

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.

repomaa avatar Jun 04 '16 18:06 repomaa

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.

poinck avatar Jun 04 '16 19:06 poinck

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.

repomaa avatar Jun 05 '16 19:06 repomaa

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.

poinck avatar Jun 06 '16 19:06 poinck