Skip to content
Discussion options

You must be logged in to vote

Hi, that part is basically making the anchors change depending on where the bar is placed.

For example:

top: barPosition !== "bottom"
bottom: barPosition !== "top"
left: barPosition !== "right"
right: barPosition !== "left"

This means:

  • if the bar is at the bottom, don’t anchor it to the top
  • if the bar is at the top, don’t anchor it to the bottom
  • if the bar is on the right, don’t anchor it to the left
  • if the bar is on the left, don’t anchor it to the right

So it is still using true or false, but instead of writing them manually, the value is calculated from barPosition.

For example, if:

barPosition: "top"

then this becomes:

top: true
bottom: false
left: true
right: true

That makes the pa…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Axenide
Comment options

Answer selected by Axenide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants