DBuit / Homekit-panel-card

Homekit panel card for home assistant
MIT License
304 stars 54 forks source link

3-wide tile width too short when using "noPadding: true" #82

Closed ryantrip closed 3 years ago

ryantrip commented 3 years ago

As seen in the first screenshot. I see your calculation here for the "noPadding" option is as follows:

calc((var(--tile-width, 100px) * 3) + (20px * 2) + (5px * 3) + 20px - 4px)

Screen Shot 2020-09-08 at 11 30 15 PM

I find that adding + 4 instead of subtracting at the end fixes the issue:

calc((var(--tile-width, 100px) * 3) + (20px * 2) + (5px * 3) + 20px + 4px)

Screen Shot 2020-09-08 at 11 34 15 PM
cs42 commented 3 years ago

I think it basically needs to be this

calc((var(--tile-width, 100px) * 3) + (20px * 3) + (6px * 2) + 6px)

single button width 3 + single button padding sum 3 + plust single button margin sum * 2 (the space betweeb); I just don't understand, why the +6px is needed, but it is for me to fit. The same calculation would be needed for all other spanning buttons, so basically for a N column button:

calc((var(--tile-width, 100px) * N) + (20px * N) + (6px * (N-1)) + Z)

I don't if Z is always 6px, I would, if I knew the reason for this addition...

cs42 commented 3 years ago

calc((var(--tile-width, 100px) * N) + (20px * N) + (6px * (N-1)) + Z)

Though my calculations seem plausible, it only works on desktop but not on Android. There the box is too small.

wtrbuit commented 3 years ago

@ryantrip This should be fixed in the latest release 0.5.9. Can you verify this?

ryantrip commented 3 years ago

Apologies for the late reply, the issue still appears to be prevalent.